Reputation: 411
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?
Upvotes: 0
Views: 1454
Reputation: 11
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.
Upvotes: 1
Reputation: 13256
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.
Upvotes: 0