Coloring input type=input browse button; uploading multiple files

Discussion in 'Javascript' started by Ron Brennan, May 10, 2004.

  1. Ron Brennan

    Ron Brennan Guest

    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.
    Ron Brennan, May 10, 2004
    #1
    1. Advertising

  2. Ron Brennan

    Dominique Guest

    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


    "Ron Brennan" <> wrote in message
    news:...
    > 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.
    >
    >
    >
    Dominique, May 11, 2004
    #2
    1. Advertising

  3. Ron Brennan

    Ron Brennan Guest


    > 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


    -----------------------------
    > 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,

    --------------------------------
    Yes, please, please send me the code for option 1. It's exactly what I want
    to do.

    Ron Brennan, May 11, 2004
    #3
  4. Ron Brennan

    Ron Brennan Guest

    I forgot to say thank you.

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

    Thank you very much,
    Ron.
    Ron Brennan, May 11, 2004
    #4
  5. Ron Brennan

    Ron Brennan Guest

    Dominique,

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

    Ron.



    "Dominique" <> wrote in message
    news:c7qmk0$361$...
    > 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
    >
    >
    > "Ron Brennan" <> wrote in message
    > news:...
    > > 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.
    > >
    > >
    > >

    >
    >
    Ron Brennan, May 14, 2004
    #5
  6. JRS: In article <>, seen in
    news:comp.lang.javascript, Ron Brennan <> posted at
    Thu, 13 May 2004 21:05:07 :

    >Lines: 82


    >
    >Dominique,
    >
    >My e-mail to you this evening bounced back becuase you've exceeded your
    >e-mail capacity.
    >
    >Ron.
    >
    >
    >
    >"Dominique" <> wrote in message
    >news:c7qmk0$361$...
    >> ... ...


    Which should help to remind you not to quote the whole of a previous
    message, which wastes everyone's resources. FAQ 2.3 para 6, FYI28.

    --
    © John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
    Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
    Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
    Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
    Dr John Stockton, May 14, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mathew George
    Replies:
    1
    Views:
    674
    Randy Charles Morin
    Sep 15, 2003
  2. Ron Brennan
    Replies:
    27
    Views:
    8,167
    Ron Brennan
    May 12, 2004
  3. Moskie
    Replies:
    0
    Views:
    388
    Moskie
    Aug 4, 2006
  4. Replies:
    3
    Views:
    205
    desprateCoder
    Oct 13, 2006
  5. Replies:
    0
    Views:
    205
Loading...

Share This Page