That should work. I'm assuming you are writing to a specific, hardcoded file path with the PHP rather than taking the filename provided by the client, which I would strongly advise against.
If this is a publicly accessible URL, you may wish to secure it somehow - which could be giving the URL...