--- binaryfile.lua-old  2010-03-31 00:00:42.000000000 +0400
+++ binaryfile.lua  2010-03-31 00:01:15.000000000 +0400
@@ -3,8 +3,6 @@
 require("mime")
 require("ltn12")

-local base64_wrap = ltn12.filter.chain(mime.encode("base64"),  mime.wrap("base64"))
-
 actions = {}

 function actions.mimetype(node, request, sputnik)
@@ -75,7 +73,7 @@
       if name and name:match("%S") and size > 0 then
          -- A file was uploaded 

-         request.params.content = base64_wrap(info.contents)
+         request.params.content = mime.wrap("base64") (mime.b64 (info.contents))
          request.params.file_type = type
          request.params.file_name = tostring(name)
          request.params.file_size = tostring(size)
Powered by Sputnik | XHTML 1.1