Re: Upload moves the file doesn't copy it..

From: Date: Thu, 15 Feb 2001 06:02:08 +0000
Subject: Re: Upload moves the file doesn't copy it..
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-39839@lists.php.net to get a copy of this message
Sorry for not being able to send you the code you requested for. But I am glad that you learnt uploading files. coming to your problem, PHP by default deletes the temporary upload file it created when the script finishes execution. You will need to explicitly make all the copies of the file that you want to keep. more information about this can be found in the Handling file uploads section of the php manual hope that helps best regards Ankur Verma HCL Technologies A1CD, Sec -16 Noida, UP India ----- Original Message ----- From: "Dhaval Desai" <dhaval_adams@yahoo.com> To: <php-general@lists.php.net> Sent: Thursday, February 15, 2001 12:38 AM Subject: [PHP] Upload moves the file doesn't copy it.. > Hi! > > > I have finally learned to upload file using php. > But the problem is that When I upload a file, it > disappears from it's place and moves to the location I > have told it to go to. It's more like a cut & paste > rather then copy and paste... > > My code is as follows: > > > > Index.html: > ****************************************************** > <html> > <head> > <title>Untitled Document</title> > <meta http-equiv="Content-Type" content="text/html; > charset=iso-8859-1"> > </head> > > <body bgcolor="#FFFFFF"> > <form method="post" action="upload.php"> > <p> > <input type="file" name="userfile"> > <br> > <br> > <input type="submit" name="Submit" value="Upload"> > </p> > <p>&nbsp;</p> > <p>&nbsp;</p> > <p>&nbsp;</p> > </form> > </body> > </html> > > > ******************************************************* > > > > Below is upload.php: > > ******************************************************* > <?php > > if (copy($userfile, "c:\\upload.txt")) > { > echo "Succesful"; > } > else > { > echo "failure"; > } > unlink($userfile); > > ?> > ****************************************************** > > > > > > Thank You! > Dhaval Desai > > > > > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail - only $35 > a year! http://personal.mail.yahoo.com/ > > -- > 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 (#39839) next »