Mochiweb:在上传文件时读取文件
我希望能够在用户上传文件时读取文件,即我想从用户浏览器读取传入的字节流。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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。
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.