By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,728 Members | 2,462 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,728 IT Pros & Developers. It's quick & easy.

Q: Html/JS form input element file upload?

P: n/a
(Sorry if this appears twice)


I know this has probably been beaten to death but
I was working with Class by Stickman -- which uses DOM to
create multiple file input elements in a form.

I'm trying to just hide all the form input elements
of type file and providing a link to call each one's
click() method. This works fine except when submitting
the actual form. IE 6 complains with "Access is denied"

Try copy/pasting the HTML below (don't forget the
attachment) and if you click the regular "Browse..."
button and submit then it works.

If you click the "My Browse..." link, select one file,
and try to submit, get "Access is denied"

Windows XP Pro SP2 with IE 6


<script src="multifile_compressed.js"></script>

<script language="Javascript">
function myBrowse() {; }


<a href="javascript:document.form1.submit()">Submit Me</a>
<a href="javascript:myBrowse()">My Browse</a>

<form name="form1"
action="javascript:alert('it works!!')"

<input id="my_file_element" type="file" name="file_1" > <!-- The
file element -- NOTE: it has an ID -->

<input type="submit">
<!-- This is where the output will appear -->
<div id="files_list"></div>
<!-- Create an instance of the multiSelector class, pass it the
output target and the max number of files -->
var multi_selector = new MultiSelector( document.getElementById(
'files_list' ), 5 );
<!-- Pass in the file element -->
multi_selector.addElement( document.getElementById(
'my_file_element' ) );

Mar 17 '06 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Rob Mitchell wrote:
(Sorry if this appears twice)

See news:19****************
Score adjusted

Mar 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.