X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=examples%2FMultipart.hs;fp=examples%2FMultipart.hs;h=8ddc6189be39a8ad942d372671819fd6f066e53f;hp=9c42e7269a4984452d8914aea1644ba02891f1eb;hb=ece223c516e66223ef1d5d8e6bbe4054a235d983;hpb=9668dc27a02b59d7bfb1e9e40af3d2619700ad69
diff --git a/examples/Multipart.hs b/examples/Multipart.hs
index 9c42e72..8ddc618 100644
--- a/examples/Multipart.hs
+++ b/examples/Multipart.hs
@@ -21,21 +21,21 @@ resMain â· ResourceDef
resMain
= emptyResource {
resGet
- = Just $ do setContentType $ mkMIMEType "text" "html"
- output ("
Multipart Form Test\n" â
- "\n")
+ = Just $ do setContentType $ parseMIMEType "text/html"
+ putChunks $ "Multipart Form Test\n"
+ â "\n"
, resPost
- = Just $ do form â inputForm defaultLimit
+ = Just $ do form â getForm Nothing
let text = fromMaybe (â
) $ fdContent <$> lookup "text" form
file = fromMaybe (â
) $ fdContent <$> lookup "file" form
fileName = fdFileName =⪠lookup "file" form
- setContentType $ mkMIMEType "text" "plain"
- outputChunk ("You entered \"" â text â "\".\n")
- outputChunk ("You uploaded a " â Lazy.pack (show $ Lazy.length file) â " bytes long file.\n")
- output ("The file name is " â Lazy.pack (show fileName) â ".\n")
+ setContentType $ parseMIMEType "text/plain"
+ putChunks $ "You entered \"" â text â "\".\n"
+ putChunks $ "You uploaded a " â Lazy.pack (show $ Lazy.length file) â " bytes long file.\n"
+ putChunks $ "The file name is " â Lazy.pack (show fileName) â ".\n"
}