This question is locked. New answers and comments are not allowed.
I know that the official way to handle large files is to up the IIS limit, but I was wondering if it would be possible to call the upload action without including the filestream in the call so that we could do our own file streaming using code like the following?
foreach (string file in Request.Files){ if (Request.Files[file].HasFile()) { var fileHeader = Request.Files[file]; string path = AppDomain.CurrentDomain.BaseDirectory + "uploads/"; string filename = Path.Combine(path, Path.GetFileName(fileHeader.FileName)); var fileStream = new FileStream(filename, FileMode.OpenOrCreate); var fileChunk = new byte[32768]; // Get the stream using (var requestStream = fileHeader.InputStream) // request.GetRequestStream()) { int cbRead; // Grab a chunk while ((cbRead = fileHeader.InputStream.Read(fileChunk, 0, fileChunk.Length)) > 0) { // Append it to the file fileStream.Write(fileChunk, 0, cbRead); } fileStream.Close(); } }}