title: AjaxFileUpload return download panel when data is json
body: <p>I use AjaxFileUpload (<a href="http://www.phpletter.com/Our-Projects/AjaxFileUpload/" rel="nofollow noreferrer">http://www.phpletter.com/Our-Projects/AjaxFileUpload/</a> ) to upload a file and get json result type response in struts2 ( code.google.struts2jsonresult.JSONResult )</p>
  
  <p>but browser always pop-up download pane, plz give me some suggestions, thanks in advance</p>
  
  <p>Here is my config in struts.xml :</p>
  
  <pre><code>......
  
  &lt;result-type name="json" class="code.google.struts2jsonresult.JSONResult"&gt;
  
  ............
  
  
  &lt;action name="doGetList" method="doGetList"  
  class="main.java.GetListAction"&gt;   
  
     &lt;result type="json"&gt;
      &lt;param name="target"&gt;jsonObject&lt;/param&gt;
      &lt;param name="deepSerialize"&gt;true&lt;/param&gt;
      &lt;param name="patterns"&gt; -*.class&lt;/param&gt;
     &lt;/result&gt;
    &lt;/action&gt;
  </code></pre>
  
  <p>and js client :</p>
  
  <pre><code>function ajaxFileUpload(){
  
  
  
      $("#loading").ajaxStart(function(){
  
                $(this).show();
  
         }).ajaxComplete(function(){
  
             $(this).hide();
         });
  
      $.ajaxFileUpload
      (
       {
        url:'doGetList.do',
        secureuri:false,
        fileElementId:'uploadfile',
        dataType: 'json',
        success: function (data, status)
        {
  
         if(typeof(data.error) != 'undefined')
         {
          if(data.error != '')
          {
           alert(data.error);
          }
          else
          {
           alert(data.msg);
          }
         }     
        },
        error: function (data, status, e)
        {
         alert(e);       
         alert(data.records);
  
        }   
       }
      )
  
    return false;
  
   }
  </code></pre>