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).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rvillan created an issue. See original summary.

rvillan’s picture

NWOM’s picture

Status: Active » Needs review