Getting the remote file path from <input type="file">
Discuss Getting the remote file path from <input type="file"> in the PHP Development forum on Dev Shed. Getting the remote file path from <input type="file"> PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.
Posts: 6
Time spent in forums: < 1 sec
Reputation Power: 0
Getting the remote file path from <input type="file">
I'm using a form to upload a file to save in a mySQL database, however I need to store the original file path on the clients (the user uploading the file) computer.
The file path is shown in the field that selects the file, I just need to post it or save it in a session somehow.
Posts: 211
Time spent in forums: < 1 sec
Reputation Power: 9
$HTTP_POST_FILES[’userfile’][’name’] - should contain the original file name of the file being uploaded so you should be able to simply assign that to a session var or a cookie or where you intend to save it.
Posts: 6
Time spent in forums: < 1 sec
Reputation Power: 0
When I use either $HTTP_POST_FILES['filename']['name'] or $_FILES['filename']['name'] I only get the name of the file and not the path.
I'm using PHP version 4.3.0 with registered_globals = off;
Posts: 211
Time spent in forums: < 1 sec
Reputation Power: 9
My appologies... I assumed after seeing:
"The original name or path of the file on the sender’s system ."
in the PHP manual when describing the use of $HTTP_POST_FILES[’userfile’][’name’] that "name or path" implied that if a path was used, a path would be present in the resulting var.