I am not sure if the issue relates to IMCE, so I hope you will forgive me if I am far of track.

Users of my drupal 7 site can upload images using IMCE to the S3 service. This part is working great. Unfortunately all uploaded data is set to "everyone, read". Is there a way to tell IMCE (or perhaps AWSSDK, if this handles the upload) to make uploaded files "private"? I have been searching the web for days now and I might be missing the obvious so I would be very thankful for any kind of help.

Comments

ufku’s picture

Drupal applies chmod(0664) to uploaded files by default. And AmazonS3 treats this mode as public because it is readable by all. (660 would be private)

IMCE does not interfere into this workflow. You can implement hook_file_insert to change the permissions of a newly inserted file.

kressin’s picture

Status: Active » Closed (fixed)

Ufku, thanks for the hint. It was exactly what brought me on the track to solve the problem (sorry for answering so late). I solved the problem by changing acl=public to acl=private in amazons3streamwrapp.inc. All data uploaded to S3 now is set to private automatically. I know it is kind of a hack but it works for me.