Best way to upload multiple files from a browser

前端 未结 9 1306
太阳男子
太阳男子 2020-12-12 17:37

I\'m working on a web application. There is one place where the user can upload files with the HTTP protocol. There is a choice between the classic HTML file upload control

9条回答
  •  心在旅途
    2020-12-12 17:57

    I implemented something very recently in Silverlight.

    Basically uses HttpWebRequest to send a chunk of data to a GenericHandler.

    On the first post, 4KB of data is sent. On the 2nd chunk, I send another 4K chunk.

    When the 2nd chunk is received, I calculate the round trip it took between first and 2nd chunk and so now the 3rd chunk when sent will know to increase speed.

    Using this method I can upload files of ANY size and I can resume.

    Each post I send along this info:

    [PARAMETERS] [FILEDATA]

    Here, parameters contain the following: [Chunk #] [Filename] [Session ID]

    After each chunk is received, I send a response back to my Silverlight saying how fast it took so that it can now send a larger chunk.

    Hard to put my explaination without code but that's basically how I did it.

    At some point I will put together a quick writeup on how I did this.

提交回复
热议问题