IE tries to download json response while submitting jQuery multipart form data containing file

后端 未结 9 669
别那么骄傲
别那么骄傲 2020-12-14 15:03

I\'m trying to submit a form with a file field in it via jQuery.Form plugin, here\'s the code:

$(\'form\').ajaxSubmit({
  url: \"/path\",
  data         


        
9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-14 15:11

    This site has some info about wrapping the response in a http://forum.jquery.com/topic/jquery-form-malsup-ie7-file-download-security-warning-on-ajax-file-upload

    I seemed to be able to fix my problem by making my server return the JSON as a string. Then I used JSON.parse() inside the complete event.

提交回复
热议问题