0
I have a form that I need to upload to an ftp.
When I put the fashion down no file loads.
<form id="frmEnviar" name="frmEnviar" data-ajax="false" method="post" runat="server" enctype="multipart/form-data">
</form>
Already the form below loads file.
@using (Html.BeginForm("Inserir", "ProtocoloLatam", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
}
Because the first way doesn’t work?
Add
action="arquivo.ext"
to see if it resolves, informing the file that will receive the request.– Rodrigo Tognin
Buddy, you have the method="post" in the form, but what is this action?
– gabrielfalieri
Sorry Gabriel, I didn’t realize I had the method. But this "action" informs the page that you will receive the form data.
– Rodrigo Tognin
Action is the destination to which the form should point, in your case in the second option it is sending to "/Protocololatam/Insert", already in what you built, missed to direct the post somewhere declaring the action... soon it will try to post to its own route
– Leandro Angelo
Well, this "Protocololatam/Insert" is sent via an ajax request, via get
– gabrielfalieri
How can I upload
– gabrielfalieri
Well, then the question is not about c# or Asp.Net but about javascript
– Leandro Angelo
What do you mean? The file has to be sent via javascript tb?
– gabrielfalieri
Have a look here https://answall.com//questions/9704/upload-to-archive-with-ajax
– Leandro Angelo
Let’s go continue this discussion in chat.
– gabrielfalieri
Would work with get or just post?
– gabrielfalieri