slice large file into chunks and upload using ajax and html5 FileReader

前端 未结 3 1900
借酒劲吻你
借酒劲吻你 2020-12-14 21:52

What I want to implement is:

In the front end, I use the html5 file api to read the file, and then upload the file\'s content to the php backend using ajax, and it\'

3条回答
  •  轮回少年
    2020-12-14 22:37

    This Problem is caused mostly by global restrictions of shared Hosts. They often control the amount of data and drop the Connection if Limit is overridden. I tried this several times and several ways. Always stucking at the same Position. target file was smaller and corrupted. Even taking a smaller file for upload than this size, so that the merged data fits in the limit, the result was OK. YOu have only one Chance: Get the max size increased, for files to be opened. Every time you open the target file and write the chunk Content into it, and the size overrides the Limit, the hoster will break the Connection. Example hoster: Strato Here the Limit is globally set to 16MB. I get max merge-result size double this size. No Chance to override it.

提交回复
热议问题