I have a migrate script routine that sets file references for several nodes. I was finding that the paths to these files were not matching up with the path settings that I had configured on the file field. It turned out to be an issue with the call to file_prepare_directory(). In my case, the destination directory had already existed, but I was receiving this error:
[notice] The file public://private/press_release/additional/5-steps-cert-dev-exam_0_0.pdf could not be moved to the destination of public://private/press_release/additional/5-steps-cert-dev-exam_0_0.pdf. Ensure your permissions are set correctly.
Note: The log message doesn't display the destination directory -- a patch has been submitted for that here: Logger does not record new file destination on failed move
I don't think this is an issue with my system's file permissions, because files were being placed in the expected directory when I was attaching files manually (via the node form).
Comment | File | Size | Author |
---|---|---|---|
#2 | filefield_paths-modify_destination_permissions-2844420-1.patch | 842 bytes | rvillan |
Comments
Comment #2
rvillan CreditAttribution: rvillan as a volunteer and commentedComment #3
NWOM CreditAttribution: NWOM commented