Re: upload problem...

From: Date: Wed, 22 May 2002 00:31:42 +0000
Subject: Re: upload problem...
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-98671@lists.php.net to get a copy of this message
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" <gsam@trini0.org> wrote in message news:3CEADCB5.3080706@trini0.org... > 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"); > > } > >?> > > > > > > > > > > > >

« previous php.general (#98671) next »