Aresk Posted September 16, 2016 Share Posted September 16, 2016 Using a form with enctype = "multipart/form-data and input type = "file" I can browse for a file on the users PC and upload to webpage. Is it possible to determine the full pathname of the file selected by the user? $_FILES['uploadedfile']['name'] gives just the file name not the full pathname. Is there a list of properties used by $_FILES. I can find only 'name', 'tmp_name', 'size', 'type', 'error'. Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted September 16, 2016 Share Posted September 16, 2016 (edited) No, it's not possible, and it would be a major privacy violation if the browser exposed local file paths. How my file system looks like is definitely none of your business. Why do you think you need this? Edited September 16, 2016 by Jacques1 Quote Link to comment Share on other sites More sharing options...
Aresk Posted September 16, 2016 Author Share Posted September 16, 2016 Thanks. Good point. I can stop looking. I thought it a good idea if someone uploaded to be able to offer the same file as default next time they repeated. Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted September 16, 2016 Share Posted September 16, 2016 You cannot set a default filename either (as this could be used to silently upload files with the user's consent). Quote Link to comment Share on other sites More sharing options...
Aresk Posted September 27, 2016 Author Share Posted September 27, 2016 Thanks again. I guessed this as a corollary to your first reply, but good to have it confirmed. 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.