hukadeeze Posted April 6, 2007 Share Posted April 6, 2007 Is there an element in the $_FILES array that provides the full path to an uploaded document? I'm doing server-side form validation, and there are many other fields other than the upload field. If there is an error in the form the user is sent back to correct it. I'm sending back and displaying all the correct, completed information so the user doesn't have to re-enter it. I don't want the user to have to browse for the file again, so I want the full path to show in the upload field, rather than just the filename ($_FILES['file']['name']). Link to comment https://forums.phpfreaks.com/topic/45859-accessing-user-file-path-from-_files-array/ Share on other sites More sharing options...
Hughesy1986 Posted April 6, 2007 Share Posted April 6, 2007 Not sure what you mean but there is the: $_FILES['filename']['tmp_name']; That shows the path where the file is waiting. Glen Link to comment https://forums.phpfreaks.com/topic/45859-accessing-user-file-path-from-_files-array/#findComment-222829 Share on other sites More sharing options...
Barand Posted April 6, 2007 Share Posted April 6, 2007 The server neither knows nor cares where the file originated on the client. But even if it did, you can't set the value in a file input field other than by browsing. It's read only. Link to comment https://forums.phpfreaks.com/topic/45859-accessing-user-file-path-from-_files-array/#findComment-222885 Share on other sites More sharing options...
hukadeeze Posted April 6, 2007 Author Share Posted April 6, 2007 What do you think would be a good way to handle it then? Put a note near the file input field telling them they don't have to do it again? Just let them do it again? If I didn't reload the field at all they would probably freak out and think they broke something Link to comment https://forums.phpfreaks.com/topic/45859-accessing-user-file-path-from-_files-array/#findComment-223064 Share on other sites More sharing options...
Barand Posted April 6, 2007 Share Posted April 6, 2007 You could redirect to a page that puts out a confirmation message to let them know if the upload was successful Link to comment https://forums.phpfreaks.com/topic/45859-accessing-user-file-path-from-_files-array/#findComment-223102 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.