1

I'm attempting to upload a a file using a custom context type that uses the storage class i defined thru the storage_api module. For some reason the upload of an image to it is failing with "The file could not be uploaded." I have the local file system as the initial container and should propagate to an s3 bucket after the upload.

I've tried the built in Content>Media> add file and that works fine. i think the file lands in public:// However I want to use the storage class from the storage_api.

I see the following in the dblog when i attempt the file upload that fails:

Message: The upload directory storage-field-corp-image: for the file field field_corp_image 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.

Not sure where to go from here.

1 Answer 1

1

Found the issue. Turns out the Directory Path in the local container, which is the initial container, for the storage class the content type is using NEEDS to have a trailing slash. As in:

sites/default/files/storage/

instead of:

sites/default/files/storage

it's that picky. and the log does not say its the issue. it just says it had trouble accessing the field. I found it by trial and error.

I hope this helps someone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.