php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9125 image file corrupted when upload
Submitted: 2001-02-06 07:48 UTC Modified: 2002-10-01 13:11 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: samuele_catuzzi at yahoo dot it Assigned:
Status: Not a bug Package: Other
PHP Version: 3.0.17 OS: Linux redhat 6.2 & SuSE 7.0 on i
Private report: No CVE-ID: None
 [2001-02-06 07:48 UTC] samuele_catuzzi at yahoo dot it
-php 3.0.18 under RedHat linux 6.2 , apache 1.3.14
-php 3.0.16 and 4.0.3pl1 under SuSE linux 7.0 , apache 1.3.12

I try to use upload files mechanism _in a correct manner_ with gif 
images files:
- under Windows98 i have no problems, the files are upload correctly
- under Linux with same version of php, the upload mechanism work but  
image file result corrupted

then I try to open corrupted file and original file with hexeditor
and surprise! 

I have found that the head of corrupted file begin like this:

0000 43 6f 6e 74 65 6e 74 2d  54 79 70 65 3a 20 69 6d Content- Type: im
0010 61 67 65 2f 67 69 66 0d  0a 0d 0a 47 49 46 38 37 age/gif. ...GIF87
0020 61 98 01 4a 00 f7 00 00  00 00 00 ff ff ff 00 00 a..J.?.. ...???..

a correct image file begin like this:

0000 47 49 46 38 37 61 98 01  4a 00 f7 00 00 00 00 00 GIF87a.. J.?.....
0010 ff ff ff 00 00 00 00 00  00 00 00 00 00 00 00 00 ???..... ........

I also tryed with jpeg , bmp , tif  and these files are uploaded 
correctly on SuSE 7.0 php 4.0.3pl1 .
on RedHat 6.2 php 3.0.18 JPEG, files (and other??) some time are 
uploaded correctly but some time are corrupted with same bug:

0000 43 6f 6e 74 65 6e 74 2d  54 79 70 65 3a 20 69 6d Content- Type: im
0010 61 67 65 2f 6a 70 65 67  0d 0a 0d 0a ff d8 ff e0 age/jpeg ....????

the problem may be apache versions or some library versions ???

with this bug I have a big problem for my work, for now I have try to 
write a little C program that correct files corrupted but I prefer a 
real solution!

 help me!

Samuele Catuzzi 
(from latina, italy)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-01 13:11 UTC] hholzgra@php.net
We are sorry, but can not support PHP 3 related problems anymore.
Momentum is gathering for PHP 5, and we think supporting PHP 3 will
lead to a waste of resources which we want to put into getting PHP 5
ready. Ofcourse PHP 4 will will continue to be supported for the
forseeable future.

file upload has been rewritten completely for php 4.2
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 30 22:01:28 2024 UTC