[Javascript] file upload

jsWalter jsWalter at torres.ws
Mon Nov 29 12:24:51 CST 2004


"Iztok asked:

<snip>
> The user will select all the files he or she wants' to upload...
<snip>
> Can someone help me? After that I thought I would
> make for every file it's own <input type="file"> tag.It will be
> hidden of course. Is this the correct way?

In a word, no.

You can't modify the contents of a FILE tag. Period.

I like Mikes idea of showing/hiding successive FILE tags, but my issue
with that could be long upoload times if many files are sent, and/or large
files are sent.

What many system do to get around this is to sent up each file in turn,
add them to a TEXTAREA when they are uploaded, have the server store them
in a temp area for your use. Then, when the user is finished, the "page"
is sent with some marker that IDs the list of pages as theirs, and the
server process handles it as needed.

It's a bit tedious, but it is safer than uploading several at once.

Hope that helps.

Oh, BTW: This is not really a JS issue, this is a standard HTML nd server
side process issue.

JS will just help you show/hide FILE tags (for Mikes idea) and it wouldn't
help you at all for my idea.

Walter





More information about the Javascript mailing list