php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24574 File corruption during file upload
Submitted: 2003-07-10 01:02 UTC Modified: 2003-07-10 10:24 UTC
From: ivan at artenergy dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.3.2 OS: FreeBSD 4.7/Apache1.3.27
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ivan at artenergy dot com
New email:
PHP Version: OS:

 

 [2003-07-10 01:02 UTC] ivan at artenergy dot com
Description:
------------
Uploading files, e.g. JPGs or GIFs, using HTML form/PHP interface results in corrupted files.

Reproduce code:
---------------
HTML form fragment:
...
<form method="post" enctype="multipart/form-data" action="update.php"><input type="file" name="image">
....

update.php fragment:
...
copy("$image", "/www/image/$image_name") or die("Couldn't upload $image_name !");
...

Expected result:
----------------
Selected local file uploaded to the web server as 
"/www/image/$image_name"

Actual result:
--------------
File is indeed uploaded, file length is correct, but it is
corrupted. 
Typically all 0x00 bytes are replaced with 0x20.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-10 10:24 UTC] sniper@php.net
See bug #11066 (and search the bug database next time BEFORE you submit any reports)

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 15:01:30 2025 UTC