Ok that didn't work, so far if I select a file other than a .jpg it returns me an error which is what I need to happen, however if I select an image with a .jpg extension for upload it tells me the upload was successful but when I check the directory there is never anything there. Any other ideas? thanks in advance, Jas "Gerard Samuel" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Take a look at move_uploaded_file() > http://www.php.net/manual/en/function.move-uploaded-file.php > > 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, > >Jas > > > ><?php > >session_start(); > >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