Page 1 of 1

How to get the full path in userfile?

Posted: Thu Jun 18, 2009 3:26 pm
by organizedchaos
Hi! Can anyone tell me how to get the whole path including the filename when I browse for a file? The file could be anywhere so I just couldn't add the path in my code.

This code only gives me the filename:

Code: Select all

$filename = $_FILES['userfile']['name'];
Thanks!

Re: How to get the full path in userfile?

Posted: Thu Jun 18, 2009 8:04 pm
by organizedchaos
I see. :( Can you just suggest something to help me? What I'm trying to do is to convert word documents to html file. The class that I found requires the whole path or if the path isn't specified, it automatically searches for it in My Documents. My problem is what if the file isn't in my documents? I don't want to have to put all the files in My documents. :( And also there's nowhere in the code where it specified that it will search for the file in My Documents so meaning it's automatic and I can't change it?

Re: How to get the full path in userfile?

Posted: Thu Jun 18, 2009 9:34 pm
by requinix
...Huh?

If the file was uploaded then just feed it $_FILES[uploadname]["tmp_name"]. That's the full path of the file on your server.
(Unless you moved it, of course.)