Re: HELP WITH UPLOAD REQUIRED!!!!!!!!

From: Date: Tue, 16 Jan 2001 01:53:58 +0000
Subject: Re: HELP WITH UPLOAD REQUIRED!!!!!!!!
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-34723@lists.php.net to get a copy of this message
Unlink works on some installations, not others. I think it works on NT but not 95 or perhaps the other way around. Why is this? Unlink is hardly an unsupported system call in windows! Anybody know? Gfunk - http://www.gfunk007.com/ I sense much beer in you. Beer leads to intoxication, intoxication to hangovers, and hangovers to... suffering. ----- Original Message ----- From: "Chris Lee" <lee@mediawaveonline.com> To: <php-general@lists.php.net> Sent: Tuesday, January 16, 2001 12:47 PM Subject: Re: [PHP] HELP WITH UPLOAD REQUIRED!!!!!!!! > are you running php in safemode? > > according to > http://php.net/manual/en/function.unlink.php > unlink() may not work with windows servers, I have no personal experience > with windows so I can not confirm this. > > have you tried > http://php.net/manual/en/function.move-uploaded-file.php > this might be better suited. > > Chris Lee > Mediawaveonline.com > > > "Mike Yuen" <myuen@ucalgary.ca> wrote in message > > news:Pine.A41.4.10.10101151429320.171104-100000@acs5.acs.ucalgary.ca... > > I am trying to allow various users to upload their own picture. What I > > would like to happen is to have the copy statement rename the .jpg > > image to the username. For example, if the username is mike, then I want > > the picture to be renamed mike.jpg > > > > The following is a snippet of code: > > > > <?PHP > > print "$CUserName" //ensures name is carried over from session > > > > if(copy($userfile,"c:/phpweb/userpics/$CUserName.jpg")) > > { > > print "Your picture has been uploaded!"; > > } > > else > > { > > print "Error"; > > } > > > > unlink($userfile) > > ?> > > > > The errors I get are as follows: > > Warning: unable to open " for reading: Permission denied in > > c:\phpweb/fuploadconfirm.php on line 15 > > Warning: Unlink failed (No such file or directory) in > > c:\phpweb/fuploadconfirm.php on line 31 > > > > Line 15 is the if copy($userfile........) line in the above code > > > > AND > > > > Line 31 is the unlink statement at the end. > > > > Thanks, > > Mike > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#34723) next »