I wanted a fancy upload bar for my website and felt this one 's pretty cool I have had different problems but finally managed to upload.
Question : How do I get the path of the uploaded file to insert in my database?
In the function handle_file_upload
in the upload.class.php
file, after $file_path
, I added:
$url = 'YOUR PATH HERE/files/'.$file->name;
And then I included the $url
var in my db insert. The YOUR PATH HERE
would be whatever your structure is to get the /server/php/files/
directory.
There is no way to get the file path as it is stored on the client machine (security issue).
You can get only the file name.
EDIT: Although some browsers (IE) may provide you with the path you cannot and should not rely on it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.