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]

Reply via email to