I use Valums to upload large files under MVC3 Razor.
Somehow It uploads only small files about 1Mb.
I already used web.config settings which should be good Large File Uploads Fails in Chrome with Valums
But it doesn’t help.
Here is my JS
<script type="text/jscript">
var uploader = new qq.FileUploader({
element: document.getElementById('file-uploader-demo1'),
allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'],
sizeLimit: 1024*1024*1024,
action: '/Test/UploadFile',
multiple: false,
onSubmit: function (id, filename) {
this.params.param1 = $("#ImageTitle").val();
},
onProgress: function (id, fileName, loaded, total) {
// $('.qq-upload-list').hide();
},
onComplete: function (id, fileName, responseJSON) {
$('.qq-upload-list').hide();
$("#ImageTitle").val("");
genTable(responseJSON);
}
});
function genTable(data) {
var contentData = '';
contentData += "<img class='myclass' src='/Test/Orders/thumb-" + data + "' />";
$("#ImageList").html(contentData);
}
window.onload = createUploader;
</script>
Here is my web.config
<httpRuntime
maxRequestLength="1024000"
requestLengthDiskThreshold="1024000"
executionTimeout="18000"
/>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true"/>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
There are two possible reasons. First, your
maxRequestLengthattribute of thehttpRuntimehttp://msdn.microsoft.com/en-us/library/e1f13641(VS.71).aspx
has too small value. The runtime rejects too large requests and you just have to make this value larger.
However, the default request limit is around 4mb and you seem to be unable to post files larger than 1mb. It is possible then that your hosting provider imposes its own limits on the request size. If this is so, you’d have to negotiate the limit directly with your provider.