3
I have the following form:
@using (Html.BeginForm("importCSV", "Administrador", FormMethod.Post, new { @id = "upldFrm", @enctype = "multipart/form-data" }))
{
<input id="file" name="file" type="file" />
<label style="color:red; white-space: pre-line">@ViewBag.Message</label>
}
<script>
$(function () {
$("#file").change(function () {
$("#upldFrm").submit();
});
});
</script>
When I send any file (.csv
, .jpg
, .txt
, and others) it works perfectly, but when I try to send a file like: Arquivo 16.03.15.rar
it does not even arrive in the action, generates the error of the image below.
The goal is to allow only uploading files .csv
, but I can’t let problems like this happen. Someone can help me?
When you say "not even in Action", what exactly happens?
– Leonel Sanches da Silva
I updated the question my friend... Well, I put a breakpoint in the action he is calling, and when I send a file . csv for example, it gets there, but when I send such quoted file, the error is generated without even getting into the action.
– Jedaias Rodrigues
Apparently the error is when it sends a very large file, regardless of the extension
– Maicon Carraro