Ashesh
Ashesh

Reputation: 949

should i chmod files after upload in php?

I'm uploading files to the server with a PHP Script. I also have scripts to let the user delete these files. Should I chmod the file after upload to give user the rights to delete the file ?

chmod ($baseDir . $_FILES['file']['name'], 0644);

Upvotes: 1

Views: 62

Answers (1)

grebneke
grebneke

Reputation: 4494

As a general rule, no. If the uploading script and the deleting script run as the same system user, it already has the permissions to delete it.

Just try uploading a file, and then delete it?

Upvotes: 2

Related Questions