Permissions


#1

Hi
I’m trying to have people upload pictures to my site. I coppied a script that does this but it won’t work for me. Is this something that can be done on dreamhost. If I can do it do I have to set up a special folder with permisions for this. This is the page URL that I set up
http://www.professionalwebdesign.org/crows/FileUpload.php
I’m a beginner, so please keep it simple.
Thank You
tom


#2

Hi tom-

It looks like there’s an error on line 9 of your PHP script. :slight_smile: Seriously, though, it’s hard to give you any input without seeing the code you’re using.

What is the intended destination of pictures that are uploaded? A directory on the Web server? A MySQL database? In either case, this permissions error suggests that the script is not providing the anonymous Web user necessary credentials to connect.

-Gabe

Warning: Unable to create ‘dhtop.gif’: Permission denied in /home/.dacca/tambler/professionalwebdesign.org/crows/FileUpload.php on line 9
Your file could not be copied.


#3

Here is the script that i used. I got it from the book “visual quickstart guide ‘PHP for the world wide web’” I saved my file as FileUpload.php
i created a users folder on my web site to store the information but that obviously wasn’t right. What am i doing wrong.

Handling File Uploads <?php /* This next conditional determines whether or not to handle the form, depending upon whether or not $File exists. */ if ($File) { print ("File name: $File_name

\n"); print ("File size: $File_size

\n"); if (copy ($File, "$File_name")) { print ("Your file was successfully uploaded!

\n"); } else { print ("Your file could not be copied.

\n"); } unlink ($File); }

print (“Upload a file to the server:\n”);
print ("<FORM ACTION=“FileUpload.php” METHOD=POST ENCTYPE=“multipart/form-data”>\n");
print (“File <INPUT TYPE=FILE NAME=“File” SIZE=20>
\n”);
print ("<INPUT TYPE=SUBMIT NAME=“SUBMIT” VALUE=“Submit!”>\n");
?>