php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21819 Corrupted uploaded binary files
Submitted: 2003-01-22 08:59 UTC Modified: 2003-02-13 19:58 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ele at roundex dot com Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4.3.1 OS: Linux RedHar 8.0
Private report: No CVE-ID: None
 [2003-01-22 08:59 UTC] ele at roundex dot com
When uploading binary files (about 5kB and up), they get corrupted, not the whole file but some way from the beginning. The size is increased about 90%, actual number of bytes varies with different browsers.

PHP versions tried: 4.3.0 and 4.3.1-dev (200301211230).

Configured with './configure' '--with-apxs2' '--with-openssl' '--enable-calendar' '--with-curl' '--with-gd' '--with-jpeg-dir=/usr/lib' '--with-png-dir=/usr/lib' '--enable-mime-magic' '--with-mysql' '--enable-magic-quotes' '--with-zlib-dir=/usr/lib' '--with-config-file-path=/etc'

Apache version: 2.0.43

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-22 15:44 UTC] iliaa@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


Please provide the script you are using to upload the files and the script used to handle the actual files uploads.
 [2003-01-22 16:07 UTC] ele at roundex dot com
The script goes like this:

<html>
<body>
<?
echo $_FILES['userfile']['name']." ";
echo $_FILES['userfile']['type']." ";
echo $_FILES['userfile']['size']." ";
echo $_FILES['userfile']['tmp_name']." ";
echo $_FILES['userfile']['error']." ";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], "/var/www/hosts/se8.org/htdocs/temp/image.jpg")) {
echo "moved";
} else {
echo "not_moved";
}
?>

<p>

<form action="test.php" method="post" enctype="multipart/form-data">
<input type="file" name="userfile">
<input type="submit">
</form>

</body>
</html>


When I upload a 11463 byte image, it grows to 22575 bytes and corrutps.
 [2003-01-22 20:03 UTC] sniper@php.net
I guess the problem (again) is apache2. It's really not ready for production yet, so you should consider using
Apache 1.3.27 which really works..

Reclassified.

 [2003-02-03 02:48 UTC] jan dot safranek at siemens dot com
This seems as duplicate of bug 19263 - workaround mentioned there worked for me. Just comment out whole <Files> section in php.conf
 [2003-02-03 03:21 UTC] sniper@php.net
Please check the solution from bug #19263 and confirm
if it solves this. If so, feel free to set this to 'Bogus' too..

 [2003-02-13 19:58 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

assuming the solution from the above mentioned bug report
solved this..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 23 06:01:35 2024 UTC