Scala Lift - 从发布数据保存文件(值上传器)

发布于 2025-01-06 04:48:54 字数 753 浏览 1 评论 0原文

我有以下对象,

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丶视觉 2025-01-13 04:48:54

我认为您可以在此处调整代码形式 要上传文件,请将文件保存到您的服务器。
该示例将其保存到 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文