why are you decoding again?
if you want the image to be displayed as base64 you need to display it 
encoded all the way

PS: you should also think about making a convenience method for this like I 
once did:
https://github.com/dereuromark/tools/blob/2.0/Lib/MyHelper.php#L70 
so that you can access it just like

echo $this->Html->imageFromBlob($this->data['Card']['photo']);


Am Donnerstag, 17. Mai 2012 12:54:16 UTC+2 schrieb Mangesh Sathe:
>
> Hello all ,
>
>  I am new to cakephp.  I am using cake 1.3 .
>  i want to upload image by encoding it in base64.
>
>  here is my image code in  view  
>       form is enctype multipart encoded 
>
>       <?php echo $this->Form->file('photo', array('id' => 
> 'fileField','label'=>false)); ?>
>
>  here is my base64 encode in  controller
>       
>      
>       $photo = base64_encode($this->data['Card']['photo']);
>       echo $photo;
>
> i am using this code on another view
>     <img src="data:image/jpg;base64,<?php echo base64_decode($photo);?>"   
> width="25" height="24" />
>
> It is not getting encoded in base64.
>
> Thanks in advance.
>
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to