PHP File Uploads

software development

#1

Hello.
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: http://us2.php.net/features.file-upload

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: http://www.voidinput.com/upload.phps

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

Thanks! -Abyss

-vI-


#2

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)


#3

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?

-vI-


#4

Tried, still not working :confused:

Anyone else have any clue?

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

-vI-


#5

(obligatory off-topic and useless post)

Call 007!

Wholly


#6

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

My website


#7

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].


#8

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…


#9

I don’t beleive I know of that program
Silk

My website


#10

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.

-vI-