Scala Lift - 从发布数据保存文件(值上传器)
我有以下对象,
object Upload_Dispatch extends RestHelper {
serve {
/* Presentation ---------------------------------------------*/
case "upload_presentation" :: Nil Post req => {
println(req.body.map(_.length))
JsonResponse(JObject(JField("success", JBool(true)) :: Nil))
}
}
}
它来自这里:
https://github.com/timperrett/lift-file -uploader
value 上传脚本位于:
http://valums.com/ajax-upload/< /a>
我已经一切正常,返回的响应等,我如何实际保存正在发送的文件?如何访问实际的字节数组以便可以使用 FileOutputStream?
预先感谢,非常感谢任何帮助:)
I have the following object
object Upload_Dispatch extends RestHelper {
serve {
/* Presentation ---------------------------------------------*/
case "upload_presentation" :: Nil Post req => {
println(req.body.map(_.length))
JsonResponse(JObject(JField("success", JBool(true)) :: Nil))
}
}
}
This comes from here:
https://github.com/timperrett/lift-file-uploader
The valums uploader script is here:
http://valums.com/ajax-upload/
I've got the whole thing working ok with the response returned etc, how do I actually save the files that are being sent? How do I access the actual byte array so I can use FileOutputStream?
Thanks in advance, any help much appreciated :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可以在此处调整代码形式 要上传文件,请将文件保存到您的服务器。
该示例将其保存到 MongoFS。
这个将其保存到磁盘
I think you can adjust the code form here to get your file upload save the files to your server.
That example saves it to MongoFS.
This one saves it to the disk