phpcakephpphpthumb

Off-server thumbnailing is not allowed phpthumb cakephp


I am working on cakephp based project

Making thumbnails using phpThumb plugin

need to create thumbnail of an external image link

phpThumb is generating thumbnail from this server

http://watermark.propspace.com

but not from this server

https://propspaceuae.s3.amazonaws.com

i am getting this error Off-server thumbnailing is not allowed

to solve this i did the following

in phpThumb.config.php file

i changed nohotlink_enabled false

$PHPTHUMB_CONFIG['nohotlink_enabled'] = false;

and added domain on nohotlink_valid_domains

$PHPTHUMB_CONFIG['nohotlink_valid_domains'] = array(@$_SERVER['HTTP_HOST'],'propspaceuae.s3.amazonaws.com');

but not worked for me

i found this solution here Link

but this is not working for me.


Solution

  • I got the solution by changing this line

    $PHPTHUMB_CONFIG['nohotlink_enabled'] = false;

    to

    $PHPTHUMB_CONFIG['nohotlink_enabled'] = true;

    and i added domain in phpThumb.class.php file

    var $config_nohotlink_valid_domains = array('propspaceuae.s3.amazonaws.com');

    And it worked for me.