Page 1 of 1

Uploading a file

Posted: Wed Apr 16, 2003 6:35 am
by franky_1
Hi there

I'm new to PHP, and I'm trying to upload a file
but everytime I try I get the following error message :
Warning: Unable to create '/usr/www/users/weblet/fmtest/uploads/Ckinfo.txt': Permission denied in /usr/www/users/weblet/fmtest/upload_go.php on line 18

Warning: Unable to move '/tmp/phpyZaS22' to '/usr/www/users/weblet/fmtest/uploads/Ckinfo.txt' in /usr/www/users/weblet/fmtest/upload_go.php on line 18
Possible file upload attack! Heres some more info:
Array
(
[userfile] => Array
(
[name] => Ckinfo.txt
[type] => text/plain
[tmp_name] => /tmp/phpyZaS22
[error] => 0
[size] => 1392
)

)
Line 18 is

Code: Select all

<?php
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir.$_FILES['userfile']['name']))
?>
The directory I'm uploading does exist, so if anyone can help me or point me in the right direction I would very thankful.

Almost forgot

Posted: Wed Apr 16, 2003 6:38 am
by franky_1
my uploaddir is

Code: Select all

<?php
$uploaddir = "/usr/www/users/weblet/fmtest/uploads/";

?>

Posted: Wed Apr 16, 2003 6:45 am
by m3mn0n
What is your chmod perms on that directory? You need to have read/write in order to upload to it.

Posted: Wed Apr 16, 2003 8:02 am
by franky_1
hi

I have no idea. How can I find out, and more importantly how do I set it and what must I set it to. :?

Posted: Wed Apr 16, 2003 8:26 am
by Jim
If you use a unix server and an FTP program like Cute FTP, Smart FTP or WSFTP Pro, right click on the file or directory you want to CHMOD, scroll down to "CHMOD" on the list you'll get, and change the number in the little box to either "775" or "777."

COOL!!!!

Posted: Wed Apr 16, 2003 8:50 am
by franky_1
It works fine, and thanks fir the help :D