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