I have an Azure Blob Storage where I want to upload some files.
Index.cshtml
@using (Html.BeginForm("File_post", "MyController", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div class="editor-label">
<p>
<input type="file" name="file" />
</p>
<input type="submit" value="Upload" />
</div>
}
MyController.cs
public ActionResult File_post(HttpPostedFileBase file)
{
CloudBlobContainer blobContainer = Initialize(); // This Initialize my blobContainer
CloudBlockBlob blob;
blob = blobContainer.GetBlockBlobReference("myfile");
blob.UploadFromStream(file.InputStream);
Return("Index");
}
I tested with a 3.5Mo file, it works even with a 20Mo file. Now I try with a 33Mo and firefox gives me the basic error : The connection was reset...
Edit: When I put
public ActionResult File_post(HttpPostedFileBase file)
{
Return("Index");
}
It gives me the same error, so I think it's not caused by my c# code.
Any idea ? Thanks a lot !