- Part of my app allows users to upload a personalized image to act as the header/banner.
- I don’t need to collect/store those images but one time. If they update with another banner, the old one needs to go away (unlink()).
The problem: When a user uploads the image file, it works the first time. When the user tries uploading a new image file, it appears that everything executes properly, but the old image remains.
Above move_upload_file(), I added:
The above code was unsuccessful in solving the problem.
I read somewhere that it could most likely be due to not having permission to overwrite files from the app.