Uploading large file to NodeJS webserver

前端 未结 3 948
悲&欢浪女
悲&欢浪女 2021-02-09 02:50

I am serving up my web application using NodeJS server (ExpressJS) currently. One of the new requirements is for the users to be able to upload large videos (potentially in gigs

3条回答
  •  南旧
    南旧 (楼主)
    2021-02-09 03:55

    Having done this myself (~20GB files, without multer) I can recommend the following (Probably most of which you have considered, but for completeness):

    1. Choose an appropriate upload control (or write your own, but basically something that chunks up the data is best. I used plupload I think)

    2. On the server make an API to handle the received chunk data, and write it out to a temp location during upload (You may want to hash and check individual pieces as well).

    3. Once upload complete, check file (I used a hash generated by the client, and checked it against the uploaded data)

提交回复
热议问题