Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Firefox3 - Changes value returned from file input form element

9 views
Skip to first unread message

Philip

unread,
Jun 17, 2008, 11:32:17 PM6/17/08
to
Hi,

I have just noticed that Firefox 3 changes what is returned by the value
attribute of a file input form element. Please see the code sample below:

<html>
<head><title>Test File Input Value</title></head>
<body>
<form name="fileTest">
<input name="theFile" type="file">
<input type="button" value="Test"
onClick="alert(document.fileTest.theFile.value)">
</form>
</body>
</html>

In IE and earlier versions of Firefox clicking the "Test" button would
show an alert dialog that outputs the complete path and filename of the
file selected by the user. In Firefox 3 only the filename is returned
NOT the path.

This is a problem for me as in my web application I use the value of the
file input element as a parameter to a signed Java applet embedded in
the page which does some client side processing on the selected file.

Is this change deliberate? If not is it a bug? Are there a work around?

Thanks,
Phil

Sam Dutton

unread,
Jun 24, 2008, 7:42:04 AM6/24/08
to
We're having the same problem.

This articles shows how to use file input in Firefox 3...

http://soakedandsoaped.com/articles/read/firefox-3-native-ajax-file-upload

...but it won't help existing pages that rely on getting the full
path!

Sam Dutton


On Jun 18, 4:32 am, Philip <philip.how...@evalua.com.au> wrote:
> Hi,
>
> I have just noticed that Firefox 3 changes what is returned by the value

> attribute of afileinputform element. Please see the code sample below:
>
> <html>
>   <head><title>TestFileInputValue</title></head>


>   <body>
>     <form name="fileTest">
>      <inputname="theFile" type="file">

>      <inputtype="button" value="Test"


> onClick="alert(document.fileTest.theFile.value)">
>     </form>
>   </body>
> </html>
>
> In IE and earlier versions of Firefox clicking the "Test" button would

> show an alert dialog that outputs the complete path and filename of thefileselected by the user.  In Firefox 3 only the filename is returned
> NOT the path.
>
> This is a problem for me as in my web application I use the value of thefileinputelement as a parameter to a signed Java applet embedded in

Adam

unread,
Jul 11, 2008, 5:22:33 PM7/11/08
to
0 new messages