Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 8th, 2003, 06:13 AM
Registered User
 
Join Date: Jun 2003
Location: , , .
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
Reply With Quote
  #2 (permalink)  
Old June 9th, 2003, 06:46 AM
Registered User
 
Join Date: Jun 2003
Location: , , Canada.
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
Reply With Quote
  #3 (permalink)  
Old June 10th, 2003, 01:34 AM
Registered User
 
Join Date: Jun 2003
Location: , , .
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
Reply With Quote
  #4 (permalink)  
Old June 10th, 2003, 07:02 AM
Registered User
 
Join Date: Jun 2003
Location: , , Canada.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:38 AM.


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