NYCPHP Meetup

NYPHP.org

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

Rainero, David J (David) rainero at lucent.com
Tue Nov 5 11:19:45 EST 2002


Try using FTP to transfer the file between Unix & NT.  Make sure you use the bin option.  the file is probably getting padded with ^M or something.

Dave

-----Original Message-----
From: Hans Zaunere [mailto:zaunere at yahoo.com]
Sent: Tuesday, November 05, 2002 10:26 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Apache 2.0 + PHP Latest Stable corrupting
images?



--- 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/


--- Unsubscribe at http://nyphp.org/list ---




More information about the talk mailing list