[thelist] Local path of uploaded file

Roel Mulder roel.mulder at gmail.com
Wed Oct 28 15:41:18 CDT 2009

Thanks again all. You're right, we live with it for ages already, and
it seems that we are actually stuck with it. It would be kind neat
though, to not have visitor have to search for their files twice. So,
of I go looking for an AJAX thingy.


On Wed, Oct 28, 2009 at 2:29 PM, Sarah Adams <sarahwbs at gmail.com> wrote:
>> So I have a form that uploads a file, along with some text fields. PHP
>> validates the form, and returns the visitor to the form if not all
>> criteria are met.
>> The upload form is then empty.
>> My question is: how do I keep the local path + file name in the <input
>> type="file" /> input field?
>> Google points me back in time to 2003:
>> http://forums.devshed.com/php-development-5/getting-the-remote-file-path-from-input-type-file-56068.html
>> where it should be provided by js. However, when I test it, it only
>> returns the original file name (same as $_FILES['userfile']['name'] ).
>> Actually FF returns the file name "test-file.pdf" only, IE returns
>> "C:\fakepath\test-file.pdf" whilst the file came from a network share.
>> Does anyone have a suggestion, or provide a hyperlink to a working example?
> It's not possible without replacing the file input with a flash or java
> gadget of some sort. File inputs are read-only for security reasons.
> Allowing javascript access to the local file system would be very, very bad.
> --
> sarah adams
> web developer & programmer
> http://sarah.designshift.com
> --
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !

More information about the thelist mailing list