Friday, January 26, 2024

[SOLVED] PHP: generated zip has chmod 644

Issue

I'm using ZipArchive to create Zips and then provide them to download. I save them in a folder and I want to delete all every night (my cronjob would do that).

But now I've seen that they are created using CHMOD 644, and if I try to delete them with my script, I always can't delete them because I do not have sufficient rights.

How can I declare that every new Zip which is created uses 777?

Thanks for help! Flo


Solution

Are you able to chmod it like so?

chmod("/somedir/somefile", 0777); 


Answered By - George Reith
Answer Checked By - Terry (WPSolving Volunteer)