Protect thumbnail and library images from media browser from being deleted in Drupal 7 -
i have drupal 7 site authenticated users can create webpage raise money charity. can add picture media library using media browser. however, if delete page, deletes thumbnail , library image db , site. i've tried file lock module, doesn't work. i've set user permissions images cannot deleted; doesn't work. images used in other places need keep them library future users. appreciated.
assuming you're running on linux box, can make files read-only using crontab.
as superuser, type
crontab -e
add line crontab
* * * * * cd /var/www/mysite/sites/default/files/yourcustomimagesfoldername/ && find . -type f -exec chmod 444 {} +
to explain, line changes directory images folder, makes every single file in images folder read-only, iterates through subdirectories well. may need tweak chmod based on distro.
it not alter directory permissions.
best,
Comments
Post a Comment