Skip to content Skip to sidebar Skip to footer

Upload File Using Jquery Form Plugin

I am using Jquery form plugin to upload file in Ajax request.File is successfully sent to server but on response browser is asking to save response with following popup Here

Solution 1:

This is a common issue with IE and iframe (used by jquery form plugin to upload files with ajax).

I solved in two steps:

1) Server Side: remove headers, send back just the content.

2) Client-Side: do not set the ajax request dataType parameter and on success use the following code to extract json:

success: function(data)
{
    try{
        jsonData = jQuery.parseJSON(data);
        // continue process with json encoded data
    }
    catch(e)  
    {
        // handle parsing error
    }

}

Post a Comment for "Upload File Using Jquery Form Plugin"