2013-07-11 23 views
2

我使用jQuery文件上傳插件(基本版本)https://github.com/blueimp/jQuery-File-Upload上傳文件在後臺與carrierwaverails3jquery文件上傳只提交文件而不是整個表格數據

<script type="text/javascript"> 
     //auto upload files on change event 
     $(function(){ 
     $("form input[type='file']").fileupload({ 
      dataType: 'script', 
      add: function (e, data) { 
       data.submit(); 
      }, 
      done: function (e, data){ 
      }, 
      });   
     }); 
    </script> 

data.submit()方法提交整​​個表單數據與需要被上傳,因爲性能被認爲這是我的應用程序的一個大問題文件一起。

如果有人遇到這個問題,請幫助我。

+1

爲什麼要投票? –

回答

0

如果不在軌道中提交表單,則無法上載文件,因此如果可能的話,僅使用文件字段上傳按鈕創建另一個表單。

相關問題