简体   繁体   English

大型文件上传,无需更改php.ini

[英]Large size file upload without changing php.ini

I created chunk file using jquery slice function 我使用jquery slice函数创建了块文件

var chunk = blob.slice(start, end);

and append this chunk to new formData 并将此块附加到新的formData

var fd = new FormData();
fd.append('fileToUpload', blobFile);

and send this blob to upload.php file. 并将这个Blob发送到upload.php文件。 But i getting only the $_file contain Array 但是我只让$ _file包含数组

(
    [fileToUpload] => Array
        (
            [name] => blob
            [type] => 
            [tmp_name] => 
            [error] => 1
            [size] => 0
        )

)

. My requirement is upload large file into server and i am using file operation for append the received contents to file. 我的要求是将大文件上传到服务器,并且我正在使用文件操作将接收到的内容追加到文件中。 My problem is i am not getting the what i passed from jquery and what i get is string "blob". 我的问题是我没有得到我从jquery传递的信息,而我得到的是字符串“ blob”。 How can i chunked file upload without using plugins. 我如何在不使用插件的情况下分块上传文件。

There is one error triggered. 触发了一个错误。 error = 1 means post_max_size error and I reduced the chunk size. error = 1表示post_max_size错误,我减小了块大小。 The problem solved and now its works perfect and i can upload large file without any packet loss. 问题已解决,现在可以正常工作了,我可以上传大文件而不会丢包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM