PHP is a programming language Backend very powerful and widely used on the web. With this language we can create, modify and delete files, but for this, those files must have the appropriate permissions, read, write, and execute.
On this occasion, starting from the basis that we want to delete a file from the system, we will use the function chmod from PHP (similar to the Linux chmod command) to give the file permissions.
To give all permits to a file from PHP we will use:
< ? php // File to which we will give permissions $ file = "myarchive.jpg"; // We assign all the permissions to the file chmod($ file, 0777); ? > |
With this, the file has all the permissions and we can delete it.
We can also make the change directly from our ftp client or from our cPanel.
Have you used something similar? Leave us a comment.
Hello, although I have not tested your code yet I ask you:
-I want to create any.csv file in any folder.
-I do everything known and the file does not appear.
-I tried countless variants without success.
Do you know any safe way that works?
Thank you !!!