Mochiweb:在上传文件时读取文件

发布于 2024-08-14 07:34:30 字数 107 浏览 3 评论 0原文

我希望能够在用户上传文件时读取文件,即我想从用户浏览器读取传入的字节流。Mochiweb 可以吗?如果没有,我需要在哪里查看/修改?

如果雅司病还有其他更简单的方法,那就太好了。谢谢。

I want to be able to read a file just as it is being uploaded by the user, i.e. I want to read the incoming stream of bytes from the user's browser.. Is that possible with Mochiweb? If not, where do I need to look/modify?

If something else easier exists on Yaws, that will also be great. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

饭团 2024-08-21 07:34:30

是的。

Mochiweb 的级别都相当低,因此您可以轻松访问它。

查看 mochiweb_request 模块。 mochiweb_request:stream_body/3 可能就是您想要的。不确定它如何处理作为多部分请求发送的文件附件,但这应该不难弄清楚。

Yup.

Mochiweb is all pretty low level, so you get access to that pretty easily.

Check out the mochiweb_request module. mochiweb_request:stream_body/3 is probably what you're after. Not sure how it handles file attachments sent as multipart requests, but that shouldn't be too difficult to figure out.

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