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