0

Is there a way that the following script show the full path to the file and not just the file name?

 $DataSaveDirectory= $_POST['datasavedir'];

 Data Save Directory: <input name="datasavedir" type="file" VALUE="<?PHP print $DataSaveDirectory ; ?>">
Jack
  • 725
  • 1
  • 10
  • 27
  • 1
    http://stackoverflow.com/questions/5814155/how-to-get-the-file-path-in-html-input-type-file-in-php and also this one http://stackoverflow.com/questions/15201071/how-to-get-full-path-of-selected-file-on-change-of-input-type-file-using-jav – Jose Manuel Abarca Rodríguez Jun 11 '15 at 17:16
  • http://php.net/manual/en/reserved.variables.server.php – Funk Forty Niner Jun 11 '15 at 17:19
  • this will fail `$_POST['datasavedir']` because we're dealing with files. – Funk Forty Niner Jun 11 '15 at 17:20
  • @Fred So what is the alternative ? – Jack Jun 11 '15 at 17:28
  • 1
    `$_FILES['datasavedir']` and using a valid enctype as well as a POST method. However, your question is unclear. Can you elaborate on what it is exactly that you wish to achieve? Do you want to show the full path of the uploaded image? or from a fetched file already on your server? – Funk Forty Niner Jun 11 '15 at 17:47
  • I want to choose a file from my computer and save some data and I want to see the full path on my webpage when I choose the file. For example: Desktop/test/test.txt. I only see test.txt now. – Jack Jun 11 '15 at 18:57

0 Answers0