简体   繁体   中英

Krajee Bootstrap File-Input fails to pass uploadExtraData with large files

I have an ajax upload using file-input that works perfectly for even medium sized uploads (ex: 12mb works fine). However, with a large upload (ex: 40mb) it is either not passing the "extra" form data, or the server-side code (classic ASP) is trying to process them before the upload is complete and the data is passed?

The js is as follows:

 $('#file').fileinput({ maxFileSize: 45000 , maxFileCount: 1, required: true, uploadUrl: 'ajax_upload.asp?', uploadAsync: false, dropZoneEnabled: false, uploadExtraData: function (previewId, index) { //get checkbox values var strShowTo = '' showToUserIDs: $("input[name=showToUserIDs]").val(), $("input[name='showToUserIDs']").each(function () { if ($(this).is(':checked')) { thisValue = $(this).val() strShowTo = strShowTo + thisValue + ','; } }); var formData = new FormData(); var formData = { privateFolder: $('select[name="privateFolder"] option:selected').val(), title: $("input[name=title]").val(), sendEmailNotices: $("input[name=sendEmailNotices]").val(), body: $("input[name=description]").val(), showToUserIDs: strShowTo }; return formData; }, }); 

I dont think its a server setting issue as I have already set the Maximum Requesting Entity Body Limit to 100mb and the Request Filtering / Edit Feature Settings / Maximum allowed content length to 100mb.

在此处输入图片说明 在此处输入图片说明

When I upload a large file, all of the uploadExtraData values are "" in the server-side code. However, they are being listed in the "form data" section of the network inspector in Chrome:

在此处输入图片说明

It turned out that the server side code was using a component (Motobit ASP Upload) that was setting the max form size to 15mb

Dim Form: Set Form = Server.CreateObject("ScriptUtils.ASPForm")
Form.SizeLimit = 12*&H100000

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