URL and Link repository

Friday, November 1, 2019

PHP Set File Permissions

Recently, images uploaded to SpiderOnFire via the Widespread Augmented Reality app were suddenly writing to the server with permissions 0600. No es bueno, since these images need to be viewed in a web browser and on Android. Naturally, the server guys had no idea why the sudden deviation from the default upload permissions of 0644. Therefore I had to add "chmod($target_dir, 0644);" in all my upload and image resizing scripts. Seems to have fixed the issue, but I am sure that I have broken something else by going back in to change code that hasn't been touched in 4 years.