Currently, the php allows anyone to write files on server without authentication.
An effective auth could involve a shared secret (placed in php via generate).
For a request the client hashes all request data plus the secret (plus the date+time to avoid replay attacks) and the php validates it on the server side before any action is taken