I'm trying to use a private file system on Drupal 8.4.2 (standard profile with mostly default values), and noticed that files from fields that use a private file folder can't be uploaded:
Error: "The upload directory private://2017-12 for the file field field_private_attachment could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled."
My private file folder has rwxrws--- permissions, and the status report shows no further issues.
So I did some light digging and found out that the field was configured to use the default "[date:custom:Y]-[date:custom:m]" as file directory.
If I use an empty or static value instead, the files are uploaded.
But with images this only works if no image style is selected, or else this error pops up in the log:
Unable to generate the derived image located at private://styles/large/private/filename.png.
Is this a bug, or did I miss something else?
Comments
Comment #2
seirerman CreditAttribution: seirerman commentedComment #3
cilefen CreditAttribution: cilefen at Institute for Advanced Study commentedComment #4
BerdirCan't reproduce, creating folders works fine here for an an image field using private files.
Also not related to the default value issue because it also can't create image style directories.
Check the logs, sometimes Drupal logs there if it can't create directories, might be some advanced permission problem.
Comment #5
seirerman CreditAttribution: seirerman commentedI think I can reproduce this now, and the issue might be related to the language module and setting a second language besides english as default:
Would you mind giving it a try?
Comment #6
BerdirAh, multilingual, of course.
I think this might be a duplicate of some existing issues in that case, have a look at #2797639: For multi language private files FileDownloadController is used for the ImageStyle instead of ImageStyleDownloadController
Comment #7
seirerman CreditAttribution: seirerman commentedThanks!!1
The patch from #2797639 fixed this, it seems.
Comment #8
cilefen CreditAttribution: cilefen at Institute for Advanced Study commentedgood!