POST a form with Jquery AJAX When input is a File

后端 未结 2 1428
心在旅途
心在旅途 2021-02-09 06:17

I have several areas where I use AJAX to submit text fields.

 var name = $(\"input#name\").val(); 

   $.ajax({  
      type: \"POST\",  
      url: \"bin/proces         


        
2条回答
  •  庸人自扰
    2021-02-09 06:33

    This is typically done using an iFrame to send the file to the server.

    The jQuery Form Plugin is a great resource for that.

    Here is another upload script which uses xhr when possible (FF, Safari) and falls back gracefully to iFrame if necessary (IE)

提交回复
热议问题