ajax file upload

后端 未结 3 1677
一整个雨季
一整个雨季 2021-01-07 00:35

I am struggling to get a file uploaded, processed and displayed without reloading the page. What do I use for jquery to get the file posted to the server properly?



        
3条回答
  •  独厮守ぢ
    2021-01-07 00:57

    You can do it by putting the upload form in an iframe and communicating between the main window and the frame with javascript. It's ugly but it's the only way to do it in some browsers.

    jQuery File Upload is an awesome plugin that incorporates async XHR uploads and falls back on an iframe for browsers that are not capable. It also supports drag and drop (for capable browsers) out of the box. It's not the simplest plug-in in the world to use, but well worth the effort, it covers all the bases.

提交回复
热议问题