473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Q: Html/JS form input element file upload?

(Sorry if this appears twice)

Hi,

I know this has probably been beaten to death but
I was working with Class by Stickman --
http://www.the-stickman.com 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


<html>
<head>

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

<script language="Javascript">
function myBrowse() { document.form1.file_1.click(); }
</script>

</head>
<body>

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

<form name="form1"
enctype="multipart/form-data"
action="javascript:alert('it works!!')"
method="post">

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

<input type="submit">
</form>
Files:
<!-- This is where the output will appear -->
<div id="files_list"></div>
<script>
<!-- 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' ) );
</script>

</body>
</html>
Mar 17 '06 #1
1 4455
Rob Mitchell wrote:
(Sorry if this appears twice)


See news:19****************@PointedEars.de
Score adjusted

PointedEars
Mar 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: hamacher | last post by:
I have a particular need to an application . . . I need users to specify a directory (with path) on their filesystem on an HTML page. All I need at the server is a string representation of the...
4
by: John Fereira | last post by:
So, one of the limitations of multipart-form handling is that when an <input type="file" ..> tag is used it will bring up a window which allows a user to select a file for upload but won't allow...
21
by: strutsng | last post by:
<input type="file"> only allows the user to browse for files. How about "browse for folder" dialog? Can html/javascript do that? I couldn't find any syntax for that. If not, please advise what...
1
by: John Wolff | last post by:
I’m trying to upload a file to a Web Service. I have to submit the file using a standard HTML form with the <input type=“file” /tag. Ultimately, we are submitting the file from a Flash 8...
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
4
by: redoranda | last post by:
hi im a new user here. apparently im working on a project that is creating a dynamic form. Assume user can insert the data into text field and upload csv file, csv file may have two columns. user has...
2
by: robert112 | last post by:
This is quite a hard one guys. ***Some necessary back ground Info*** I have an asp.net 1.1 application that uses a WYSIWYG to return some html created by the user in the admin section of the...
8
by: VUNETdotUS | last post by:
My goal is to upload files without submitting the form. I am not looking for the code here but rather a concept. I did a little research and discovered that I can submit a form to an invisible...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.