Base 64

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
mtbiking
-


Joined: 18 Mar 2004
Posts: 66

PostPosted: Mon Jul 19, 2004 1:39 am    Post subject: Base 64 Reply with quote

i hi i want to know if someone will pass on that script to cange files into base64

i know smeone posted it on the how old is everybody thread but i cant find it so if you know it put it on here thanks
Back to top View user's profile Send private message
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Mon Jul 19, 2004 2:18 am    Post subject: Reply with quote

Esta aqui:

<?
//Enter your image location below in place of 'picture.gif or jpg'.
//Example $file = 'mypicture.gif';
// Copy and paste the output to a php file.
$file = 'picture.gif or jpg';
$pic = fopen ($file, "r");
$size=filesize ($file);
$type=substr("$file",strrpos($file,".")+1);
$cont = fread ($pic, $size);
fclose ($pic);
$code=base64_encode($cont);
$piccode=chunk_split("'$code",50,"'.<br>'");
echo "header(\"Content-type: image/$type\");<br>
header(\"Content-length: $size\");<br>
echo base64_decode(<br>$piccode');";
?>
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group