ringojs 文件上传示例
有人有使用ringojs 将文件上传到服务器的示例吗?
Does anyone have an example of uploading a file to the server using ringojs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
有人有使用ringojs 将文件上传到服务器的示例吗?
Does anyone have an example of uploading a file to the server using ringojs?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
有一个简单的上传示例演示应用程序,但它将上传存储在内存中,这对于大多数应用程序来说不是一个好主意。要将上传保存到临时文件,您当前必须执行以下操作(这是上传演示操作的修改版本):
不幸的是,将上传保存到临时文件时存在一个错误,我刚刚修复了这个错误,所以您'必须手动使用当前的 git 快照或补丁文件
modules/ringo/webapp/fileupload.js
:http://github.com/ringo/ringojs/commit/1793a815a9ca3ffde4aa5a07c656456969b504f9
>我们还需要一些高级方法来为下一个版本执行此操作(例如设置
req.uploadTempDir
属性)。我将为此打开一个问题。There's a simple upload example in the demo app, but it stores uploads in-memory which is not a good idea for most apps. To save uploads to a temporary file you'll currently have to do something like this (this is a modified version of the upload demo action):
Unfortunately, there was a bug with saving uploads to temp files that I just fixed, so you'll have to use a current git snapshot or patch file
modules/ringo/webapp/fileupload.js
manually:http://github.com/ringo/ringojs/commit/1793a815a9ca3ffde4aa5a07c656456969b504f9
We also need some high level way of doing this for the next release (e.g. setting a
req.uploadTempDir
property). I'll open an issue for this.