简体   繁体   中英

BlueImp FileUpload not uploading files after certain size

I have implemented blueimps fileupload and it works great for any file up to about 30mb. I have set the maxRequestedLength to over 100mb plus IIS 7 is set to allow file uploads of larger than this.

When uploading a file that is larger than 30mb it just fires the fail option without ever having hit the code behind.

 $('#fu-my-simple-upload').fileupload({ url: '/SubmissionPortal/UploadFile', dataType: 'json', maxFileSize: '@ViewBag.MaxFileSize' , add: function (e, data) { jqXHRData = data }, done: function (event, data) { alert("done"); if (data.result.isUploaded) { $("#tbx-file-path").val("No file chosen..."); $('input[type=submit]').click(); } else { alert(data.result.message); } }, fail: function (event, data) { if (data.files[0].error) { alert(data.files[0].error); } }, progress: function (e, data) { var progress = parseInt(data.loaded / data.total * 100, 10); $('#progress .progress-bar').css('width', progress + '%'); } }); 

any ideas of what I am missing or doing wrong? I've searched for a few hours now and i can't find anything that explains why it stops working at such an arbitrary cut off.

Watch your Apache/PHP (or whatever web server you're using) upload limits. While this library has limits, the limits of the web server may be fooling you with a silent fail.

For instance, if using Apache & PHP, you need to edit the /etc/php5/apache2/php.ini file (how PHP layers itself inside of apache) and check the variables "memory_limit" and "post_max_size". Make sure "post_max_size" is set above what you have in this lib for a chunk limit and "memory_limit" even above that. If you don't, larger uploads will silently fail (see in apache logs to see it happening).

在url参数之后,尝试设置maxFileSize: 52428800 (greater than 30 mb, say 50 mb) ...

turns out i was missing a setting for IIS 7. i had the correct setting for IIS 6 so after adding the following it worked:

<security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="104857600" />
      </requestFiltering>
</security>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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