Coloring input type=input browse button; uploading multiple files

R

Ron Brennan

Good afternoon.

The entire task that I'm trying to achieve is to allow a user to browse and
upload multiple files simultaneously, hiding the Browse button of <input>
tags of type="file" and replacing it with a button of my own background
color and text.

The file paths I'd like displayed in a textarea and then the files uploaded
at once.

The code chunks toward my goal I got from the Web (below) I think worked
before IE 5.0 but for me produces an "Access Denied" error.

Can anybody help with any part of my problem (coloring the browse button,
listing multiple chosen files in a textarea, uploading an artibrary number
of files at once)?

Thanks, Ron.
 
D

Dominique

1) You cannot change the button that is displayed next to the input field,
BUT
what you can do is put it in a <DIV> or <SPAN> and clip the button
off --> style= width:XXpx;overlow:hidden blah blah...

2) Invoking the browse dialog can be done by calling the "click()" event on
that field
--> <button onclick="fileBrowse.click()">click here</button> where
"fileBrowse" is the name of that field...
3) You cannot place a value into that field, because the browse control
needs to specifically get the file info loaded into that form field
(fileBrowse i mean),
BUT, you CAN read the value that is placed in that field after the user
browses and selects their file...SO
you CAN then take that value and place it wherever, in a textarea or list or
whatever...but UNDERSTAND that you cannot do anything with that...

4) As for mutliple file uploading... :0)
option 1: Dynamically create a new input field
option 2: Show a max of 10 fields(although this wastes space...)

5) if you go for option 1 (i hope)
it mean you show eg. <input type="file" name="file_1">
if the user has selected his file you extract the value from -->
document.formname.file_1.value and put it in your list.
The hide that box as is, and create a new one
aaaargh....

mail me if you want this code,
too much to explain...need coffee, but a brilliant idea for uploading
mutliple files tho!!

thanks!

Dominique
 
R

Ron Brennan

1) You cannot change the button that is displayed next to the input field,
BUT
what you can do is put it in a <DIV> or <SPAN> and clip the button
off --> style= width:XXpx;overlow:hidden blah blah...

2) Invoking the browse dialog can be done by calling the "click()" event on
that field
--> <button onclick="fileBrowse.click()">click here</button> where
"fileBrowse" is the name of that field...
3) You cannot place a value into that field, because the browse control
needs to specifically get the file info loaded into that form field
(fileBrowse i mean),
BUT, you CAN read the value that is placed in that field after the user
browses and selects their file...SO
you CAN then take that value and place it wherever, in a textarea or list or
whatever...but UNDERSTAND that you cannot do anything with that...
-----------------------------
I've been trying this approach, and haven't gotten it to work for me. I
think it might work for pre-IE 5, but not later. I'll see if there is a
nuance in your code that's different than from mine


-----------------------------
 
R

Ron Brennan

I was so excited to find what I was looking for, I forgot my manners.

Thank you very much,
Ron.
 
R

Ron Brennan

Dominique,

My e-mail to you this evening bounced back becuase you've exceeded your
e-mail capacity.

Ron.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top