PDA

View Full Version : pb with a php form when uploading an image


evutza_m
11-25-2004, 06:55 PM
I've bild a form and after the user complets it he need to uploade a picture.I wanted to save the picture in a folder but these error appears:

Warning: copy(images/picture3.jpg): failed to open stream: Permission denied in ...

The cote that I uses fot putin the picture in the loder is this:

if ((!empty($poza3)) && ($poza3!="none")){
@opendir("images");
$dest3="images/picture3".$nume.".jpg";
copy("$poza3", "$dest3");
}

Please help me, it's urgent!!! I accept any solutions...

Zykaz
11-25-2004, 10:03 PM
Make sure 'write' permissions are set on the folder.

Some FTP clients can set the permissions. Otherwise, usually it's a feature in server control packages. If you do set the permissions on the folder, chmod it to 777.

evutza_m
11-26-2004, 12:58 PM
Zykaz 10X for your help, I was abble to fix that problem but now I have another one. These notice apper:

Notice: Undefined index: userfile in ... on line 14.

And on line 14 I have:

if ($_FILES['userfile']) {$message = do_upload($upload_dir, $upload_url);}

I can upload the picture to the folder i want but i don't know why these notice appears. Any ideea?

Zykaz
11-26-2004, 10:24 PM
Add this to the beginning of your script, it should get rid of it:


error_reporting(E_ALL ^ E_NOTICE);