Forum Moderators: coopster

Message Too Old, No Replies

users Upload path on client

         

bleak26

6:33 pm on Dec 29, 2006 (gmt 0)

10+ Year Member



I am writing a form script which requires validation and the upload of a file. When a user fails to fill in a form field, i send an error message back to the form for the user to read.

I do not want my user to have to re browse for the file they are choosing to upload, if their input did not pass validation.
I would like to have access to the 'path to the file' which you can see on the client machine, after they have browsed for a file. I can use this info to fill the upload form fields initial value. Could you tell me how i might access this.

I have looked at $_FILES but this only seems to give me the file name.

Thank you

henry0

11:26 pm on Dec 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could first copy the file, load it in a temp,
if all systems go then you go back to the temp move it to its final destination and delete it.

if some user input are not accepted then send back the form and expect getting the proper answers

One way or the other the file is either moved at once
or ready to be moved
And your user does not need to browse for twice

Does that make sense?