NYCPHP Meetup

NYPHP.org

[nycphp-talk] Apache 2.0 + PHP Latest Stable corrupting images?

Hans Zaunere zaunere at yahoo.com
Tue Nov 5 10:26:08 EST 2002


--- evan heller <evan.heller at alum.rpi.edu> wrote:
> Hi, 
> 
> I have apache 2.0 working with the latest version
> of php-stable module on windows 2000 server. I was
> wondering what could be causing images that are
> uploaded to become corrupted. For some reason, I
> noticed that when an image is uploaded gif or jpeg
> or just about anything, php seems to be receiving
> a  larger file than the one being sent.

This sounds like the classic binary vs text file format problem in
Windows.  UNIX makes no distinction, but Windows will try to add \\r\

at erroneous intervals (thus the large file and corruption).

> Its almost
> as if the files are being padded. Anyhow I've
> tried a bunch of things using a combination of
> safe_mode / open_basedir and upload_tmp_dir being
> changed around and nothing seems to fix this. 
> 
> Does anyone have an idea on what to do to start to
> fix this?

Depending on the functions you are using in PHP, make sure that you're
in binary mode where possible, for instance:

fopen('c:\\something','rb');

http://www.php.net/manual/en/function.fopen.php

Hope this helps,

H


__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/



More information about the talk mailing list