Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By digibrill on
Hello, my public file system path is set to:
sites/all/themes/aurum/aurum_sub/files
But when I upload images that use image styles, the link to them is incorrect when viewing the page. What happens is that the images are uploaded to the public path above, not to (as an example):
sites/all/themes/aurum/aurum_sub/files/styles/blog_773x276/public
even though that path is created by image styles. The files and folders have proper permissions (755). Any ideas? TIA!
Comments
=-=
image styles location isn't set based on the file system path as it's not an image being uploaded but generated after upload. Not sure why one would want to store the images in the theme folder. If there is any setting for it it would be in the config for image styles which I think is pretty limited.
Yes, once the regular file is
Yes, I meant that the files are just being generated into the root file system path.
You're right about the config being limited. Oh, why do you not recommend the images in the theme folder? If they are to do with that theme isn't it proper?
Thanks so much!
digibrill tic
=-=
if they are to do with the the theme my question would become why are you handling in drupal as content?
As it currently stands you are directing the software to store every file uploaded into any content will now be saved to the theme folder.
Thanks! I will have to fix
Thanks! I will have to fix that.
Do you have any idea why the image styles are generating files into the file system root?
digibrill tic
=-=
OTTOMH no. Does the same occur when the file system is returned to its default?
I've set the file path back
I've set the file path back to sites/default/files, but the issue has not changed, i.e. when I upload images that use image styles, the link to them is incorrect when viewing the page. The images are uploaded to the public path above, not to sites/default/files/styles/blog_773x276/public even though that path is created by image styles.
digibrill tic
=-=
and you are sure the image in the default files folder is an image style and isn't the original image?
if yes, where is the original image being stored?
I don't see where Drupal would ignore creating the image style folders and storing the image there unless it isn't able to write to the folder. If this is the case you would have warnings/notices in your drupal logs. Is anything relevant being printed to the drupal logs?
Oh that is so basic! I didn't
Oh that is so basic! I didn't consider checking that, but yes the image in the files dir is in fact the regular image. And the Recent log messages show this:
Type access denied
Date Wednesday, August 31, 2016 - 22:03
User Admin
Location https://www.mysite.com/sites/default/files/styles/blog_773x276/public/Te...
Referrer https://www.mysite.com/blog/12-dolorem-eum-fugiat-quo-voluptas
Message sites/default/files/styles/blog_773x276/public/Test Blog Header Image.jpg
Severity warning
Hostname 172.20.0.212
Operations
But checking all the permissions on all parts of that path shows at least 755. We did recently change the site(s) to https. Would that change anything?
digibrill tic
=-=
I'd test 775 and 777 if necessary to debug.
https: Anything is possible. Disable and test.
I'd also ensure I visit the node. I don't remember if D7 generated the image style at upload or at the time of 1st node display.
Well I have set everything in
Well I have set everything in that path to 777 and visited the node-still not able to generate to those dirs. Here is the .htaccess from the files dir. Could be something in here? (Removed comments)
digibrill tic
=-=
can be easily tested by commenting out the lines
Still getting access denied
Still getting access denied in recent log messages. I've checked all dir permission and htaccess files.
digibrill tic
=-=
let's back up a bit.
files folder is set to 777 and none of the image style folders are being generated? not even the first folder? 'styles' ?
no. Just uploads the original
no. Just uploads the original image to files dir and displays error in reports.
digibrill tic
Solved! It was missing
Solved! It was missing support for JPEGs in the GD library. I was able to upload/generate PNGs and GIFs, but not JPEGs. Thanks for the help and your time!
digibrill tic