From:             [EMAIL PROTECTED]
Operating system: Redhat Linux 7.0
PHP version:      4.0.4pl1
PHP Bug Type:     Unknown/Other Function
Bug description:  File uploads cause corruption

I have enclosed two snippets of code from two files.
The file is uploaded, but gets corrupted along the way.


echo "<FORM name=\"add\" action=\"newproductsadd.php\" method=\"post\"
echo "<TABLE width=\"93%\" class=\"contenttext\">";
echo "<TR><TD><b>Image</b></TD><TD><input type=\"file\"
echo "<TR><TD><b>Alternative Text</b></TD><TD><input type=\"text\"
echo "<TR><TD><b>Product Text</b></TD><TD><input type=\"text\"
echo "<TR><TD align=\"right\"><input type=\"Submit\" name=\"Submit\"
<TD><input type=\"Reset\" name=\"Reset\" value=\"Reset\"></TD></TR>";
echo "</TABLE></FORM>";


require "../connect.php";
echo "Uploading new image...<BR><BR>";
$url = "newproductimages/$newimage_name";
copy($newimage, "../$url");
$sql = "INSERT INTO newproducts (image, text, alt) VALUES
$exc = MYSQL_QUERY($sql) OR DIE ("Failed to $sql");
echo "Product added successfully.";
Edit bug report at:

PHP Development Mailing List <>
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