What is the best way to upload files in a modern browser

后端 未结 5 2122
孤街浪徒
孤街浪徒 2020-12-22 22:43

I want to upload a (single) file to a server and show the progress of the upload.

I know I can upload a file using HTTP POST. I\'m not familiar with web-sockets, but

5条回答
  •  甜味超标
    2020-12-22 23:35

    Probably the Javascript's file API is the best way in modern browsers:

    http://robertnyman.com/2010/12/16/utilizing-the-html5-file-api-to-choose-upload-preview-and-see-progress-for-multiple-files/

    http://www.sitepoint.com/html5-javascript-file-upload-progress-bar/

    Server side wise... I think any of the main frameworks has the HTTP file POST feature well covered.

提交回复
热议问题