Im making a jquery ajax post call, and the .success method is being called, but the response data is empty.
Javascript:
$.ajax({
type: 'post',
url: '/MediaUploader/fileUpload',
data: formData,
contentType: false,
processData: false,
})
.done(function (data) {
//Data
})
The success function is called, but the data is empty.
Controller:
[HttpPost]
public ActionResult FileUpload() {
//code
file.SaveAs(pathToSave);
return Json(str_image);
When called, the response is empty:
However, commenting out the file.SaveAs, or returning before it, causes the respond to go through:
[HttpPost]
public ActionResult FileUpload() {
//code
//file.SaveAs(pathToSave);
return Json(str_image);
When debugging, the file.SaveAs doesn't throw any exceptions, and in both cases the return is reached. Also, this problem only is occurring on the remote. On local host both versions work fine.
The response doesnt go through only after the file.SaveAs on remote server.