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']). Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.