Upload Directory problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Upload Directory problems

Post by DuFF »

Hey,
I have just created an uploader that uploads a file and adds a row in a MySQL table. The problem I'm having is with where the file uploads to. ($category is determined by a form).

Right now my script is in the folder:
uploader/

So the upload path turns out to be:
uploader/$category/filename.ext

I want the files to upload to:
$category/filename.ext

I would like to keep the script in the "uploader" folder so that I can add .htaccess to it. How can I have the files uploaded to a different subdirectory?
Any help would be greatly appreciated.
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

Nevermind, I figured it out.

$_SERVER['DOCUMENT_ROOT']
Post Reply