X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=examples%2FMultipart.hs;h=8ddc6189be39a8ad942d372671819fd6f066e53f;hb=46ea3a688edea377e83794d1387f3f2d203bb0c6;hp=9c42e7269a4984452d8914aea1644ba02891f1eb;hpb=ac2ff93f647d60d43ca3cc54eb776fe0f701ac9e;p=Lucu.git
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"
}