Take a look at move_uploaded_file()

Jas wrote:

>Ok here is my error message:
>Warning: Unable to open '' for reading: No such file or directory in
>upload_done.php on line 9
>I have checked permissions on the folder and they are correct, my only guess
>is that upon doing several checks, session vars, etc... it is loosing the
>file name somewhere.
>Any help would be great!  Thanks in advance,
>if (isset($HTTP_SESSION_VARS['u_n']) || isset($HTTP_SESSION_VARS['p_w'])) {
> if ($img1 = "") {
>  $error_null = "<b>You did not select a file to upload.</b><br><a
>href='upload_a.php'><b><< back</b></a>"; }
> elseif (!eregi('.jpg$', $img1_name)) {
>  $error_msg = "<b>You tried to upload an invalid image.  File must be a jpg
>file type.</b><br><a href=upload_a.php'><b><< back</b></a>"; }
> elseif (eregi('.jpg$', $img1_name)) {
>  copy("$img1", "/images/$img1_name"); // this is line 9 and my error!
>  $main = "Your file has been uploaded. If you need to make more changes
>please select the page from the menu and follow the instructions."; }
> } else {
> header ("Location: index.php");
> }

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to