Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 8th, 2003, 06:13 AM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Retrive full path name from uploaded file

Hello,
How can I retrieve the full path name of a file a user has just uploaded using my script? The script uses a form with an input type="file".
the $_FILE['userfile']['name'], $HTTP_POST_FILES['userfile']['name'] and $userfile_name only produce the file name that was uploaded. I want the dirname as well.
Thanks
 
Old June 9th, 2003, 06:46 AM
Registered User
 
Join Date: Jun 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Drizzt Send a message via MSN to Drizzt
Default

$_FILE['userfile']['tmp_name']

that will give you the path to the temp file that php makes
 
Old June 10th, 2003, 01:34 AM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Drizzt but the variable you suggest first of all does not exist. Secondly, this variable contains the path to tmp file created on my server. What I want is the path to the actual file on the user's computer. For example: C:\MyDocuments\somefolder\somefile.doc

Thanks again, please help
 
Old June 10th, 2003, 07:02 AM
Registered User
 
Join Date: Jun 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Drizzt Send a message via MSN to Drizzt
Default

no its exists but that one is spelled wrong sorry, $_FILES['userfile']['tmp_name'].
use print_r($_FILES) you'll see it.

I tried once to do what you are doing and didnt have any success getting that info from php. You could use some javascript to update a hidden text feild with that possibly?

good luck





Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting the full path of a folder vamshikrishnaD ASP.NET 1.0 and 1.1 Professional 3 August 2nd, 2007 09:16 PM
How to get Path of uploaded file in JSP murulikblr JSP Basics 0 April 17th, 2007 02:05 AM
how to call file using full path labby C# 2005 4 September 27th, 2006 11:25 PM
deleting a file after it is been uploaded yts007 Dreamweaver (all versions) 1 August 16th, 2006 01:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.