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 ?– Infra StankCommented 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.– Sami Al-SubhiCommented Jan 11, 2012 at 20:11
-
1I'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.– DaveCommented Jan 11, 2012 at 20:20
-
@Dave u r right. this cant be done in some browsers <bytes.com/topic/javascript/answers/…>– Sami Al-SubhiCommented Jan 11, 2012 at 20:40
Add a comment
|
2 Answers
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="".
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.