I am allowing a user to upload images via FTP into my
private:// location as configured under File system. This location is owned by ftpuser:apache and has write permissions for both user and group.
Then my Content Type has a field called "picture file" which is the base filename of the image, e.g. IMG_9001.jpg
Note: I am using FTP instead of an Image/Media upload because the user will be uploading hundreds of images.
In my template, I do this:
$picture_file = $node->field_picture_file['und']['value']; $picture_file = 'private://' . $picture_file; $picture_url = image_style_url('large', $picture_file);
This returns a correct URL with the itok parameter appended:
However, the image does not display. Going to the URL in another window gives an Access denied error. Even with
$conf['image_allow_insecure_derivatives'] = TRUE;
in my settings file, it still gives Access denied!
If I copy the file to the public:// location and changing the path it works. It's only the private:// location that doesn't work. Why wouldn't it work even chmodded to 777?