Bug #12892 Updated: File uploads cause corruption

From: Date: Wed, 22 Aug 2001 14:32:33 +0000
Subject: Bug #12892 Updated: File uploads cause corruption
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-64040@lists.php.net to get a copy of this message
ID: 12892
Updated by: sniper
Reported By: davidtaylor@interactive2k.com
Old Status: Open
Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Redhat Linux 7.0
PHP Version: 4.0.4pl1
New Comment:

This has been fixed in PHP 4.0.6. Please update.

And next time, read the bugs-dos-and-donts before
submitting bogus bug reports. You would have found
this information if you had searched the bug database.





Previous Comments:
------------------------------------------------------------------------

[2001-08-22 08:32:31] davidtaylor@interactive2k.com

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\" enctype=\"multipart/form-data\">";
echo "<TABLE width=\"93%\" class=\"contenttext\">";
echo "<TR><TD><b>Image</b></TD><TD><input
type=\"file\" name=\"newimage\"></TD></TR>";
echo "<TR><TD><b>Alternative Text</b></TD><TD><input
type=\"text\" name=\"newalt\"></TD></TR>";
echo "<TR><TD><b>Product Text</b></TD><TD><input
type=\"text\" name=\"newtext\"></TD></TR>";
echo "<TR><TD align=\"right\"><input type=\"Submit\"
name=\"Submit\" value=\"Add\"</TD>
<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
('$url','$newtext','$newalt')";
$exc = MYSQL_QUERY($sql) OR DIE ("Failed to $sql");
echo "Product added successfully.";

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=12892&edit=1



Thread (2 messages)

« previous php.dev (#64040) next »