IE prompting users to 'Save' or 'Open' a json file

This happens when you post data and get a json response.

IE doesn't know what to do with files of mimetype 'application/json' unlike the better browsers.


Instead of simply using jsonify, now you need to manually create a Response object, manually construct a json string, and manually set the mimetype then return that


                    #return a link to the path
                    json_response = '{"filelink":"' + filepath + '"}'
                    return Response(response=json_response, status=200, mimetype='text/plain')
                    #cant do this line, cause of the idiots who build IE 
                    #return jsonify(filelink=filepath)

Posted by JB Uy on August 15, 2013 at 09:59 PM UTC
Edited on December 13, 2013 at 08:45 PM UTC