Uploading multiple files simultaneously with Flex

前端 未结 5 892
时光说笑
时光说笑 2020-12-30 16:05

I have been working on a flex uploader, where the user can select multiple files.

It works fine when the files are uploaded in a queue (one at a time), however as so

5条回答
  •  心在旅途
    2020-12-30 16:25

    Unfortunately it's a browser limitation of 2 (depending on browser) active connections per host. Meaning only 2 uploads will be active at a time, while the other will be queued. Now this normally wouldn't really be a problem but when the uploaded files are pretty large, the other uploads will time out, even though they didn't start. There's a workaround in using subdomains every 2 uploads (upl1.mydomain.com, upl2.mydomain.com) that I didn't get to test but it should do the trick.

    References: http://anirudhs.chaosnet.org/blog/2008.06.17.html and http://www.ajaxperformance.com/2006/12/18/circumventing-browser-connection-limits-for-fun-and-profit/ (which you can get to from the first link actually).

    Also, you probably won't be able to queue the uploads in flash, because the security model requires upload method (of the FileReference) to be called as a result of a mouse click.

提交回复
热议问题