Ok,
As it’s front-end… I might:
-
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).
-
Allow a user on the front end to see the files or choose which file to delete
-
Upon choosing the file, pass the parameter to an intermediary PHP script
- /wp-themes/mehmehmeh/deleteFile.php?filename=somefile.ext
-
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?
Related Posts:
- Accessing a random image via ajax
- Why is $_REQUEST an empty array in admin-ajax.php?
- Image upload via FormData API and AJAX is not working ($_FILES always empty)
- How do I Import / Upload Files with jQuery AJAX?
- Get uploaded image and attach it to the new post
- Convert canvas to image and upload image to server
- Allow user to Upload image and manipulate it on the frontend
- Is custom behaviour possible when asynchronously uploading?
- WordPress will suddenly stop saving files uploaded by my code (ran in nopriv ajax)
- WordPress directories not writable after PHP version upgrade
- Upload multiple files via ajax from an HTML file input
- Need help with Google drive API [closed]
- Ajax date_query not working past the first iteration
- How to get original custom taxonomy slug after the slug has been rewritten?
- Ajax request not sending to server and returning – wp-admin/admin-ajax.php 400
- Why ajax doesn’t work on certain wordpress hooks and reload the page instead?
- Why ajax doesn’t work on certain wordpress hooks?
- Repeating admin-ajax.php not found error in admin
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- AJAX pagination, update current page
- Save Search System
- adjust section according to country?
- populate form fields in a loop with ajax
- dynamic dependent select dropdown
- Can’t upload image using media_sideload_image
- WordPress, AJAX and pre_get_posts using conditional tags
- Are nonces in WP REST API optional by default?
- Change “add to cart” button color based on Woocommerce product category [closed]
- Ajax request returns ‘Array’. How to output the actual results?
- How to send Ajax request from my plugin in admin dashboard?
- Posting and image insertion problems after EasyApache4 and PHP 7 upgrade
- Upload multiple images to a Woocomerce product
- Ajax call return 404
- How to add a do_action on refreshing of WP customizer?
- custom user role wordpress – grant guest access to edit.php without insert/update/delete
- Cannot execute php files in wp-content
- What is the alternative to “ when it comes to calling Media (image) files in the ‘attachment.php’ file?
- Refresh table data with Ajax
- How to pass Select value from Javascript to PHP to generate select option on change
- get_children displaying images removed from the page
- Upload file could not be moved to wp-content/uploads
- Enable custom logo upload if logo is not in header
- NGINX rewrite rules for multisite
- Setting value of session with Ajax not working
- AJAX success response is not working but it’s saving my changes
- how to make custom ajax handler?
- Attach previously uploaded image to post – current code has unexpected results
- [jQuery]Adding shortcode
- Display parent and child taxonomies in separate drop down select fields
- Show success or error messages in Ajax response to WordPress custom registration form
- How to add a Custom Mailchimp AJAX Newsletter Subscribe Form
- WordPress installation permission errors
- How do I get around “Sorry, this file type is not permitted for security reasons”?
- Plugins not working on AJAX requests
- Fancybox type popup window that’s not an iframe
- Using Select HTML in Bootstrap Popovers
- How to disable controls in theme customizer?
- Can I use a jQuery Ajax request in Code Snippets Plugin for WordPress?
- how to update and display an option without reloading the page
- Change WordPress Upload Folder using wp handle upload
- WordPress admin-ajax.php 400 bad request
- WordPress automatically adds links to uploaded images
- WordPress function when file is uploaded, deleted or edited
- WordPress Ajax Call inserting data but success response false
- Loading php file with AJAX in WordPress frontend
- wp ajax return 0
- Ajax contact form return 0
- WordPress plugin: render only page content using ajax call
- AJAX – Returning Two JSON Objects with One PHP Function
- Pull GetOption() variable into jQuery dynamically created html
- Can I get an email notification when media is uploaded to the media library?
- Get the URL of the page from which an ajax request has been launched within ajax callback
- unable to use ‘new WP_Query’ in AJAX call
- admin-ajax Firing Error 400 When Logged In
- AJAX button action in foreach
- is_user_logged_in() not working in AJAX validation call
- Unset session variable on page reload / setup but exclude AJAX
- Add Ajax Hooks and Call from Custom Template PHP
- WordPress ajax-action failing because of newline in response
- Making an AJAX call to refresh a table
- HTML escaping data with ajax requests
- Blob file download problem
- WordPress Ajax Always returning 0
- Using data sent via AJAX in multiple functions on a WP plugin
- Problem with AJAX in wordpress plugin
- load ajax using admin-ajax.php
- zip unzip attachments in wordpress
- Ajax button not working
- Function won’t run onclick using Ajax
- How to keep track of when a vote is cast?
- WordPress plugin admin page – using WordPress function in linked php file
- Load Posts on Click via Ajax into a DIV
- set post limit at load more ajax wordpress
- Use value from Ajax call in PHP function
- Woocommerce with Lazy Load php and ajax
- How to deal with too many $_POST variable conditions from ajax request at backend? [closed]
- Simple AJAX notification when the new post is added to the database
- AJAX wp_insert_user WORKS but responds with “The site is not enabled”
- Upload multiple files in randomly generated folder using wp_upload_bits
- Short code template + ajax