RE: [PHP] uploading a file
| From: | Beverly Steiner | Date: | Tue, 02 Jul 2002 14:35:31 +0000 |
| Subject: | RE: [PHP] uploading a file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-104923@lists.php.net to get a copy of this message | ||
Balaji,
I tried to implement the code you put in this email and I'm having some
problems. I am able to browse and choose a file from my system then click
upload. The php script doesn't get the value of $path.
The site is running PHP 4.2.1 on Windows NT 5.0. I am using Internet
Explorer 6.0.26. Any suggestions on what I need to add?
Thanx,
Bev
-----Original Message-----
From: Balaji Ankem [mailto:balaji.ankem@wipro.com]
Sent: Monday, July 01, 2002 12:11 PM
To: 'Phil Schwarzmann'
Cc: php-general@lists.php.net
Subject: RE: [PHP] uploading a file
Upload.html
===============
<!DOCTYPE html public "-//w3c//dtd html 4.0 transitional//en">
<HTML>
<TITLE>
FileUpload
</TITLE>
<head>
<script language="Javascript">
function check()
{
document.upload.method = "POST";
document.upload.enctype='multipart/form-data'
document.upload.action="upload.php";
document.upload.submit();
return true;
}
</script>
</head>
<BODY>
<center>
<form name="upload" Onsubmit="return check()"
enctype='multipart/form-data'>
<br><br><br><br>
<table border="0" width="100%">
<tr><td width="30%" align="right"><b><font
size="2"
face="Arial">File &
nbsp; </font></b></td><td
width="5%"></td><td
width="50%"><input type='file' name='path' size="16"
value="">
</td></tr>
<tr>
<td width="50%" align="right">
<p align="left">
</td>
<td width="5%">
</td>
<td width="50%">
<p align="left"> <input type="submit" Value="UPLOAD"
></td>
</tr>
</table>
</form>
</center>
</BODY>
</HTML>
Upload.php
================
<?php
if(copy($path,$path_name))
{
print "<br><br><br><center><font face='verdana' size=+2
color=blue>Your file $path_name has been uploaded!!!</font></center>" ;
}
else
{
print "<font face='verdana' size=+2 color=red>A problem was
encountered during your file upload.</font><br>";
}
?>
=================
-----Original Message-----
From: Phil Schwarzmann [mailto:pschwar@jhmi.edu]
Sent: Monday, July 01, 2002 9:29 PM
To: php-general@lists.php.net
Subject: [PHP] uploading a file
anyone have some code they can send me that will successfully upload a
file? I've got all the HTML correct, it's just that my PHP code ain't
working.
Thanks!
Phil