hello,
I want the user to be able to browse his own file system with a PHP script and select one file. I would like to save in a database the name and path of the file selected without uploading it. What I want is save the value of the textfield "file" used in a traditional upload script but I do not want to upload this file.
Is there a solution ? In advance, thank you.
mmm without upload... u can do a form without the ENCTYPE property u use the input type FILE then onsubmit u can copy this input in a hidden input and use it... but maybe better solutions exist...
Thank you very much Morphy.
Sorry for this question (which is probably stupid) but how do I copy the FILE input to a hidden input ? Would you have an example ?
In advance, thank you again.
- erwan -
k, try this:
this is in the head <script language="javascript"> function copy() { document.frmMyForm.hidPath.value=document.frmMyForm.fPath.value; } </script>
this is in the body <form action="handlewith.php" onsubmit="copy();" name="frmMyForm"> <input type="file" name="fPath"> <input name="hidPath" type="hidden"> </form>