403 (Forbidden) delete file image in themer folder

Ok,

As it’s front-end… I might:

  1. Set up the folder on the server so that WordPress can read/write (775 or 755 ordinarily works depending on how your server is configured in terms of user/group permissions).

  2. Allow a user on the front end to see the files or choose which file to delete

  3. Upon choosing the file, pass the parameter to an intermediary PHP script

    • /wp-themes/mehmehmeh/deleteFile.php?filename=somefile.ext
  4. In deleteFile.php put the code to do the actual file deletion and report back success/failure to the front-end user.

I am not sure about security on this… I would maybe store details of who owns a given file if its a shared folder and then check that user is the one logged in before allowing them to delete. Sort of a front-end permissions if you will?