节点。js文件上传功能:大型视频文件上传,支持中断

时间:2022-05-04 20:19:24

Is there a way to upload large movie file (around 5GB) and at some point interrupt the upload process, log out and come back to the website to resume de upload after 2/3 hours?

是否有办法上传大的电影文件(大约5GB),在某个时间点中断上传过程,退出登录,然后回到网站,在2/3小时后重新上传?

Of course, resume should be made from the same computer and referencing the same file.

当然,简历应该使用同一台电脑,并引用相同的文件。

1 个解决方案

#1


4  

It's doable using socket.io, and the HTML5 filereader API. With the filereader API you can slice and dice your video file in smaller chunks and then send those through web sockets to Node.js. Because this chunks are well defined and enumerable, you can resume the upload whenever you want as long as the server keeps track of the current chunks downloaded. You may find this interesting tutorial very similar to what your asking for.

使用套接字这是可行的。以及HTML5 filereader API。使用filereader API,您可以将视频文件分割成更小的块,然后通过web socket将它们发送到Node.js。由于这些块具有良好的定义和可枚举性,所以只要服务器跟踪当前下载的块,就可以随时恢复上传。您可能会发现这个有趣的教程与您所要求的非常相似。

#1


4  

It's doable using socket.io, and the HTML5 filereader API. With the filereader API you can slice and dice your video file in smaller chunks and then send those through web sockets to Node.js. Because this chunks are well defined and enumerable, you can resume the upload whenever you want as long as the server keeps track of the current chunks downloaded. You may find this interesting tutorial very similar to what your asking for.

使用套接字这是可行的。以及HTML5 filereader API。使用filereader API,您可以将视频文件分割成更小的块,然后通过web socket将它们发送到Node.js。由于这些块具有良好的定义和可枚举性,所以只要服务器跟踪当前下载的块,就可以随时恢复上传。您可能会发现这个有趣的教程与您所要求的非常相似。