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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to