In our application we need to browse for path(only path) to attach some image from local to sever. It's may be of manual entry like c:user\images by placing one textbox or by placing browse button .when i am trying to use browse i can able to select only file name not a path. how could i do this in php.
Asked
Active
Viewed 462 times
1
-
please clear your question.. – Sep 16 '13 at 10:30
-
The point of the file input is to *upload a file* to the server, not to reveal information about the directory structure of the client (which a server shouldn't be able to play with anyway). – Quentin Sep 16 '13 at 10:30
-
possible duplicate of [How to get full filepath when uploading files in PHP?](http://stackoverflow.com/questions/5816666/how-to-get-full-filepath-when-uploading-files-in-php) – Quentin Sep 16 '13 at 10:31
-
Let me guess you have an page where you have an option to select a file to upload and when you select any file from a location only file name is shown and you want to show the whole path of the file ? – Sep 16 '13 at 10:46
-
I have a textbox where the user specifies the folder in which he has the desired image to be uploaded,consider c:\source. another textbox to specify image name. when user clicks on submit button, we are moving that image from the source to destination folder. this is working absolutely fine in local, but after uploading on to the server it is not working.. – Ramya Sep 16 '13 at 10:57
1 Answers
0
@user2783540 It seems you are taking the path and image name and accessing that path directly with PHP. On your local it might have worked because the code was running on the same machine and the path you were giving was accessible. But from server your local path will not be accessible to PHP (running on server).
I'd suggest to use input type 'file'. Its simple, easy and good. A sample working code for that is at http://www.w3schools.com/php/php_file_upload.asp
Please let us know if you have specific need / use case for which this doesn't seem fit to you. We can discuss.

G S Bajaj
- 84
- 1
- 7
-
In google drive, we can select a folder and upload it. This uploads the folder and all its files. Are looking for a similar solution? – G S Bajaj Sep 16 '13 at 11:13
-