What is your code for opening the file?

Sounds to me like you're not opening the file as a 'binary file' in Linux.
Use 'b' as part of the fopen() statement. See http://php.net/fopen


Siggy



----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 1:48 AM
Subject: [PHP-DEV] Bug #9125: image file corrupted when upload


> From:             [EMAIL PROTECTED]
> Operating system: Linux redhat 6.2 & SuSE 7.0 on intel platform
> PHP version:      3.0.17
> PHP Bug Type:     Other
> Bug description:  image file corrupted when upload
>
> -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)
>
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to