File upload with the ability to resume (preferably in Ruby on Rails)

只谈情不闲聊 提交于 2019-12-22 05:36:10

问题


this is quite a difficult topic by all accounts. I am building a website that requires users to upload large (multi-GB). What is the best way allow users to upload a file on a website and allow the file upload to be resumed should it fail? What is the way to write this in rails?

Any ideas greatly appreciated.

Max.


回答1:


No browsers support resuming uploads.

From my Googling, Flash doesn't seem to, either.

Though I don't know enough about Java to say it's impossible, there don't seem to be any pre-rolled upload solutions that support this method.

In short, you would have to code your own out-of-browser/plugin solution. If that is not feasible, you may have to abandon this feature. Sorry!

EDIT: Actually, after using a better search query, here's a Java solution that seems to support this through partitioning the initial file: JumpLoader. Here is the documentation page for resuming downloads. Best of luck! (You will note that there are purchase links - this is only for an unbranded version, and for the source code. You can use the JumpLoader branded version for free.)




回答2:


No browser support this, In fact this cannot be done over HTTP.

You will have to write your own java applet, ActiveX control or WPF browser application to achieve this. Any of this will speak to a TCP server listening on the server side to achieve pause-and-resume upload of file.




回答3:


Six years since you asked, but for future viewers, take a look at ResumableJS. It uses HTML5 File API to break uploads into chunks. They also include a RoR example for accepting the upload.



来源:https://stackoverflow.com/questions/1977927/file-upload-with-the-ability-to-resume-preferably-in-ruby-on-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!