[eluser]@li[/eluser]
Hi,
I have some code on my website which lets a user upload their image (using the CI upload library), then attempts to resize it (using the CI image manipulation library). However after resizing, the image seems to get locked, if I try to download/view it (on my website) it says permission denied, you can't access this image, etc.
This works fine on my localhost (a windows XP machine using WAMP) but on the website which is probably a linux server, it seems to lock the image after resizing it.
Has anyone experienced this or has any ideas?
Here's my code in case it helps:
Code:
$config['upload_path'] = $dir;
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '2000';
$config['encrypt_name'] = true;
$this->load->library('upload', $config);
if (! $this->upload->do_upload('pic'))
{
$this->upload_err=$this->upload->display_errors();
$this->index();
return false;
}
extract($this->upload->data());
if ($image_height > $height_allowed || $image_width > $width_allowed)
{
unset($config);
$config['image_library'] = 'gd';
$config['source_image'] = $full_path;
$config['create_thumb'] = false;
$config['maintain_ratio'] = TRUE;
$config['width'] = $width;
$config['height'] = $height;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
}