|
Posted by Shawn Wilson on 11/21/11 11:33
"Steve" <googlespam@nastysoft.com> wrote in message
news:1133351836.468083.149130@g49g2000cwa.googlegroups.com...
>
>
>> ------=_NextPart_000_002E_01C5F533.57C1E7F0
>> Content-Type: application/octet-stream;
>> name="avatar.jpg"
>> Content-Transfer-Encoding: base64
>> Content-Disposition: attachment;
>> filename="avatar.jpg"
>>
>> /9j/4AAQSkZJRYq7FXYq7FX/2Q==
>>
>> ------=_NextPart_000_002E_01C5F533.57C1E7F0--
>
>> If I have that stored in $attachment01, then what command would write it
>> back to a file named avatar.jpg and be a picture again?
>
> <http://www.php.net/base64_decode>
>
> $img = base64_decode( $attachment01 );
> $fp = fopen( 'avatar.jpg', 'wb' );
> fwrite( $fp, $img );
> fclose( $fp );
>
> ---
> Steve
>
Thank you very much, I knew it had to be pretty easy once I got the right
function name...
--
Shawn Wilson
Navigation:
[Reply to this message]
|