Thursday, February 14, 2013

Re: Echo a image in cakephp after uploading it

Hi Marcus

Please note that when saving the image in the logos folder its manually generating an ID which i use as a safe filesystem name for storage.

This eliminates any issues that users may attempt to introduce with weird and potentially system-damaging filenames that would otherwise be directly stored on your filesystem.

So in my logos folder it saves an image as 511ca905-f170-49d5-90a0-055083176c8c which is also the ID value in the database and the filename saves it as Jellyfish.jpg.

Hope this makes sense.

Any idea on how i can fix this?

Thanks

On Thu, Feb 14, 2013 at 11:01 AM, Marcus James <marcomtl@gmail.com> wrote:
you should write :-

<?php echo $this->Html->image('/logos/'. $logo['Logo']['filename']); ?>

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: