Try opening the origianl and downloaded files in a text editor and see if
you can spot the differences...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Daniel Reichenbach <[EMAIL PROTECTED]>
Newsgroups: php.general
To: Php-General <[EMAIL PROTECTED]>
Sent: Wednesday, September 05, 2001 9:31 AM
Subject: Error while saving attachments (jpegs)


> Hy,
>
> i wrote a little cron job which fetches mails from a pop account and
> saves all contained jpeg attachments to disc.
>
> I use the following code:
> --- snap ---
> // determine attachment encoding
> $atty = imap_fetchbody($mbox, $i, $b);
>
> switch($att_ency) {
> case "base64":
> $decoded_string = imap_base64($atty);
> break;
>
> case "binary":
> $decoded_string = imap_binary($atty);
> break;
>
> case "other":
> $decoded_string = $atty;
> break;
> }
>
> // save it to disc
> echo $upload_folder.$att_name;
> $fp = fopen ($upload_folder.$att_name , "w+");
> fwrite ($fp, $decoded_string, $atty_size);
> fclose ($fp);
> --- snap ---
>
> After saving there is a difference in filesize and the image is
> unusable. Original image size is 758.204 bytes and after saving
> the attachment to disc its 759.885 bytes. What am i doing wrong
> here?
>
> Greetings from Germany,
> Daniel
>


-- 
PHP General 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