I have an intranet application that needs to upload (.iso) files that exceed 2GB. It appears there are many limiting factors to the 2GB file size.
It appears you can set yet another file size limit with with maxAllowedContentLength to approximately 4GB as it is of type uint, but what good does that do when we still are being limited by 2GB from maxRequestLength?
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="4294967295" />
</requestFiltering>
</security>
<system.webServer>
Does anyone have any solutions for uploading files past the 2GB limit?
Are you open for JavaScript Solution??. If that's the case try this jQuery plugin which allows you to upload massive data(a lot GB). It upload files using HTML5 FileReader API features and Silverlight fallback if browser doesn't have support providing a mechanism inspired on TCP/IP send and receive packages with the corresponding ACK. The files are uploaded by chunks sized as configured(defaults to 4 MB).
Plus: It also comes with a file queue mode.
Here is a sample of how you may use it in a Razor View:
$(function () {
var file = $("#file").createUploaderHtml5({
postDataUrl: "@Url.Action("Upload", "Home")",
packetSize: 4 * 1024 * 1024,
onPreparingUpload: function (plugin, ufname, umime, usize) {
plugin.settings.logger("ufname = [" + ufname + "] umime = [" + umime + "] usize = [" + usize + "]");
return true;
},
onInitPacketArrived: function (plugin, guid) {
plugin.settings.logger("guid = [" + guid + "]");
},
onDataPacketArrived: function (plugin, ack, total) {
//plugin.settings.logger("ACK [" + ack.Guid + "] packet = [" + ack.Packet + "] total = [" + total + "]");
var percent = Math.round(ack.Packet / total * 100);
$("#progressbar").attr("value", percent);
$("#percent").html(percent + " %");
},
onFileUploaded: function (pl) {
pl.settings.logger("File finished!!!");
},
logger: function(msg) {
var lg = $("#logger");
lg.html(lg.html() + msg + "<br />");
}
});
$("#start").click(function () {
file.startUpload();
});
$("#stop").click(function () {
file.cancelUpload();
});
});
Here's the code for the Upload Action:
[HttpPost]
public ActionResult Upload(FormCollection collection)
{
var packetSize = 4 * 1024 * 1024; // default to 4 MB
var filePath = Server.MapPath("~/_temp_upload/");
var result = UploadHelper.ProcessRequest(Request, filePath, packetSize);
if (result != null)
{
var metadata = UploadHelper.GetMetadataInfo(filePath, result.Guid);
// do anything with the metadata
}
if (result != null)
return Json(result);
return Content("");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With