Upload files via ExtJS.Ajax.request and ASP.NET MVC without reloading the page (ajax-style)

I want to download a file without reloading the page. My server side is ASP.NET MVC.

Ext.Ajax.request(
    {
        form: f,
        url: 'http://localhost/Mvc/file/create',
        method: 'POST',
        isUpload: true
    }

I know fileupload does not work with ajax. ExtJS do this using IFRAME After receiving the ext-all response, try to decode it. If the type of action is ActionResultor EmptyResult, then execute a fire error, if the type of action is JsonResult, Internet Explorer will try to save json-response as a file.

How should I do ajax style file upload using ExtJS without the show save save json dialog box and without errors?

Best regards, Eugene.

+3
source share
1 answer

. IFRAME. JSON , Content-Type "text/html", .

return Json(id, "text/html");
+5

Source: https://habr.com/ru/post/1789164/