tags:

views:

31

answers:

2

When retrieving the path from the input file, using $_POST, the path is being picture.jpg and I need to have the full path i.e. C:/C:\Documents and Settings...\picture.jpg

what do i have to use ???

+1  A: 

I'm afraid there is no reliable way to determine this any more. The full path used to be sent along by some browsers in $_FILES[xyz]["name"], but nowadays most browsers just send the original file name for security reasons.

Not even Flash based uploaders like SWFUpload can do this any more: See this forum discussion.

Pekka
It would be horrible if browsers did send out that information. +1
karim79
@karim79, yeah. They used to send it along until not too long ago, at least IE when you were a trusted site. It was great in a CMS, you were able to store the original location of an asset... it's a horrible security hole if allowed globally, but I really miss that possibility.
Pekka
A: 

you cant. Maybe creating a custom flash/applet that sends it. But not though normal html+php code. You can try to get the value of the 'file' input and add to a 'hidden' something like this:

jQuery('#theform').submit(function(){
   jQuery('#thehidden').val(jQuery('#thefile').val());
   return true;
});

But im not sure, i guess it depends on the browser security and configuration let you get the filepath from it.

useless
i just tested it, it returns only the filename
useless