Upload files have 644 permissions
I'm writing a script that deletes files that no longer are used. The problem is when DFP uploads files the file permissions are set to 644 which doesn't allow my delete script to delete the file. I don't want to keep a lot of orphaned images in my folder. If someone already has an image that is uploaded and the name is stored in the database lets say its called image1.jpg and they replace that image with a new one named image2.jpg then I'm trying to delete image1.jpg since it's no longer being referenced in the database. Is there a way to set the file permissions to 705 on upload? The directory permissions are set to 777.