PHP File Uploads

I’m a dreamhost customer, working on my site. I just learned PHP and MySQL recently, and I’m having somewhat of an issue.

I’ve been trying to add FTP-like features to my users on my site (Not actual FTP access, but file uploading/downloading/etc features through PHP Scripts).

I’m trying to get a successful file upload, but it’s not working. I used this tutorial to make my script:

When I use the script, I keep getting a false return on move_uploaded_file(); The source I am using to do this is here:

Does anyone know what I could be doing wrong, or if it’s something in Dreamhost I’m unaware of?

Thanks! -Abyss


I cannot see anything wrong with your script. Did you set the correct permissions for the folder you are writing to?

Simon’s website
Save $100 on 1-year plans with promo code [color=#CC0000]SCJESSEY100[/color] (details)

Well, at first, I tried creating the folder through php, it is said that using mkdir in php makes the folder have a default permissions of 0777 (All Access to Everyone). It didn’t work, so I chmodded all of the parent folders up to that, that I could, and it still was unable.

I can try again, I guess…

EDIT: I tried. It didn’t work. Anyone else have any ideas, or experience with this? Has anyone else ever succesfully used a fileupload in PHP?


Tried, still not working :confused:

Anyone else have any clue?

Does anyone have experience with these kinds of scripts actually working?


(obligatory off-topic and useless post)

Call 007!


I could not see where $path[‘root’] was set to a value.

My website

try this:

$uploadfile = getcwd() . “/users/” . $_SESSION[‘username’] . “/” . basename($_FILES[‘userfile’][‘name’]);

Note [color=#0000CC]getcwd()[/color] returns the current working directory

Save [color=#CC0000]$97[/color] (max discount) on dreamhost plans by using promo code: [color=#CC0000]97CRAZY[/color].

Hey Rooster…

Just wondering… do you use Infini-D from Metacreations?

in regards to your form, void… when I get some time later, I’ll see what I can’t figure out…

I don’t beleive I know of that program

My website

It is set previously. Located in the configuration, but it is set to the correct directory of my http files. (I verified this many times, plus, other parts of the site rely on this and work).

I’m still clueless, I’ll try using the function, but I have a feeling that won’t work.