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

后端 未结 9 672
别那么骄傲
别那么骄傲 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:23

    I came up with the following workaround (in Zend Framework):

    if (!$this->_request->isXmlHttpRequest()) {
        die('');
    }
    $this->view->assign($data);
    

提交回复
热议问题