-1

I want to let the user to locate a file then I want to pass this file location input to another page where this file will be uploaded. I'm using java-script, php, html of course

4
  • How far have you got , have you read up on php file uploading ? Commented Jan 11, 2012 at 20:06
  • I know how to upload files but here I don't want to upload. I only want to pass a file location from a form in a page to another form in another page when redirecting from the first page. is it possible with cookie. how to store the file location in a cookie and let the other form obtains it. Commented Jan 11, 2012 at 20:11
  • 1
    I'm not sure you can do this at all. Most browsers will only set the value of a file input as a result of the user pressing the "Browse" button, to prevent unscrupulous servers from putting in a hidden file input that downloads a file the user may not want the server to have.
    – Dave
    Commented Jan 11, 2012 at 20:20
  • @Dave u r right. this cant be done in some browsers <bytes.com/topic/javascript/answers/…> Commented Jan 11, 2012 at 20:40

2 Answers 2

1

You can URL encode the file-path and pass it along as a get parameter. Then read it back in from $_GET[], urldecode it and put it in the form as its value="".

0

Not sure I understand your question really but take the GET or POST input from the form, process it and store the value in a SESSION variable. You can also run checks to make sure the file path follows a desired format prior to storing in SESSION as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.