开发者

When does creating a file upload field by Javascript fail?

In a webpage I'm making I'd like to give people the option to upload several files at once. I'd like to make it in such a way that as soon as a file upload field is filled, another one is created beneath it.

Now, there's no pro开发者_StackOverflowblem in attaching myself to onchange and creating a new field by Javascript, but I seem to remember one problem about this: In some browser (I think it was some version of IE) file upload fields created with Javascript didn't work. They appeared, you could select files, but they never got uploaded. The only way to make a file upload field work was to render it in the original HTML (thus workarounds with iframes were born).

Now, that was some time ago and I can't remember which version of IE it was (or if it was IE at all). Also searching in google and SO yields no results - it fact, in several places it is suggested to create such fields by JS. So - did I just dream this, or is this an actual problem? If it is, then for which browsers?


Take a look at SWFUpload. It's a small JavaScript and Flash file upload framework that might make your job a little easier. They have a number of examples, including multiple file uploads, at http://demo.swfupload.org/v220/index.htm.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜