php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12892 File uploads cause corruption
Submitted: 2001-08-22 08:32 UTC Modified: 2001-08-22 10:32 UTC
From: davidtaylor at interactive2k dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.0.4pl1 OS: Redhat Linux 7.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: davidtaylor at interactive2k dot com
New email:
PHP Version: OS:

 

 [2001-08-22 08:32 UTC] davidtaylor at interactive2k dot 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.";

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-22 10:32 UTC] sniper@php.net
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.




 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 20:01:45 2024 UTC