I have a view in which a user can upload a file to the server.
In this view, I also have two buttons: one for loading a file and another for loading the last imported file.
In my controller, I created 2 action methods: import and export.
How can I redirect each button to the correct action method in my controller?
I tried Html.ActionLink:
<%= Html.ActionLink("Upload", "Import", "OracleFile")%>
<%= Html.ActionLink("Download", "Export", "OracleFile")%>
Html.ActionLink did not do this trick. The action links led me to the right action methods, but they generated a GET request. Thus Request.Files.Count = 0.
I need a POST request.
Note. The most intriguing part is that the download worked, and suddenly it stopped working. I saw that some people face the same problems with FileUpload tasks in which Request.Files is always empty. I think it is empty because you need a message to the server. Is not it?
source
share