I'm build an application with ASP.Net MVC 5. When uploading a big file, well not that big (200MB), the browser gives me a "Connection Reset" error. The hosting is done by Godaddy (Deluxe - shared hosting plan).
I searched countless forums and of course here and the answer is almost always the same:
Add to system.web:
<httpRuntime maxRequestLength="2147483647" executionTimeout="999999"/>
And/or Add to system.webServer:
<security>
<requestFiltering>
<requestLimits maxUrl="32767" maxQueryString="32767" maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
It must be place in Web.config (at root not the one in views folder).
I know that maxRequestLenght
and maxAllowedContentLenght
are not the same units (byte vs kilobyte). So I tried different conbinaision, same number, different one...
I also tried calling GoDaddy and ask them if it could be on thier end, they said, no, but they told me that I could add a ".user.ini" file at the root directory containing something like:
upload_max_filesize=2000M
memory_limit=128M
max_execution_time=99999
post_max_size=2000M
max_input_time=99999
That did not work either...
Here is code, if you need the controller, just ask, but since there is a timeout on the browser, I don't see the point:
View:
@using (Html.BeginForm("CreateSingleTune", "Upload", null, FormMethod.Post, new { enctype = "multipart/form-data" }))
{
@Html.AntiForgeryToken()
...
<div class="form-group">
@Html.Label(Resource.SampleLabel, new { @class = "control-label col-md-2" })
<div class="col-md-10">
<input type="file" multiple="multiple" data-val="true" data-val-required="@Resource.ImageRequiredErrorMessage" id="SingleTuneViewModel_Sample" name="SingleTuneViewModel.Sample" />
@Html.ValidationMessageFor(model => model.SingleTuneViewModel.Sample, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="@Resource.CreateButton" class="btn btn-primary" />
</div>
</div>
...
}
Model:
public class SingleTuneViewModel
{
[Required]
[Display(Name = "Title")]
public string Name { get; set; }
[Required]
[Display(Name = "Album")]
public string AlbumName { get; set; }
[Required]
[Display(Name = "Tune")]
public HttpPostedFileBase Tune { get; set; }
[Required]
[Display(Name = "Sample")]
public HttpPostedFileBase Sample { get; set; }
[Display(Name = "Price")]
[DisplayFormat(DataFormatString = "{0:F2}", ApplyFormatInEditMode = true)]
public decimal UnitPrice { get; set; }
}
Can Someone help, I'm out of ideas and it seems so simple. Is my only option to use "chunk" ?