Uploading files with IE

Y

Yanick

Hi, I'm writing a class that will enable the user to upload files to
the server without reloading the current page (using target="iframe"),
and it works just fine in Firefox, but when I test it in IE, first of
all, the iframe is not targetted at all, and IE stupidly opens a new
window, second the <input type="file" element looses it's name
attribute for some reason... I tried using DOM and assigning the
element thru innerHTML, both will just not work in IE (and will just
fine in Firefox). Those interested to have the source code (commented
in french) may just ask me. But if anyone had similar problems, and
would want to share with me, I'd really much appreciate, because this
is driving me insane !

Thanks !
 
R

Randy Webb

Yanick said the following on 7/29/2006 12:30 PM:
Hi, I'm writing a class that will enable the user to upload files to
the server without reloading the current page (using target="iframe"),
and it works just fine in Firefox, but when I test it in IE, first of
all, the iframe is not targetted at all, and IE stupidly opens a new
window, second the <input type="file" element looses it's name
attribute for some reason... I tried using DOM and assigning the
element thru innerHTML, both will just not work in IE (and will just
fine in Firefox). Those interested to have the source code (commented
in french) may just ask me. But if anyone had similar problems, and
would want to share with me, I'd really much appreciate, because this
is driving me insane !

What this has to do with javascript, I am not sure. But, post a URL to a
sample page that displays the behavior.
 
Y

Yanick

What this has to do with javascript, I am not sure. But, post a URL to a
sample page that displays the behavior.

Well, first of all, the class is written in Javascript... but anyways,
I've found the answer I was looking for ; the problem comes because IE
doesn't like direct DOM manipulation (for some reason) so, instead of
passing the <input> element (created via document.createElement), I
created the whole <form> block from a string (i.e. : "<form id="blah"
....><input name="foo" type="file" /></form>"), then I set var
inputElement = document.getElementById('foo'); ... to cut the whole
thing short, instead of using createElement (that IE doesn't like) I
passed by the getElementById, and it worked...

BTW : I always wondered by innerHTML was faster than the DOM functions
?

Well... to those with the same problem, mine is solved :)

Thanks anyway Randy.
 

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
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top