As part of a data grid, I want the user to be able to upload a file. I accomplish this via a jquery ajax call to the server. Here's my ajax call:
var formData = new FormData();
formData.append("file", Data.File); //Data.File is a File object from a file input
$.ajax({
type: "POST",
url: "@Url.Action("UploadFile")",
data: formData,
contentType: false,
processData: false
});
And, here's my controller action signature:
[HttpPost]
public IActionResult UploadFile()
When I test this locally via IIS Express, it works perfectly. But, when I publish to the IIS web server it only gives me 404 errors. I've researched possible causes on the IIS end, but they all seem to do with big files. The files I'm testing with aren't big; All the ones I've tested with are under 1 MB. I also have another page where I allow file uploads via ajax, and that page does not experience any problems locally or on the web server.
This is not the only ajax call being made on this page but it is the only one failing.