WordPress.org

Ready to get started?Download WordPress

Forums

Frontend Uploader
delete files from front-end (13 posts)

  1. Daelorn
    Member
    Posted 1 year ago #

    Hi,

    Great plugin!
    Is there a way for users to delete their uploaded files from front-end?

    Cheers,
    Laurent

    http://wordpress.org/plugins/frontend-uploader/

  2. nicole2292
    Member
    Posted 11 months ago #

    I would also like this feature. I think it is pointless not to show a thumbnail preview of the uploaded images and a delete function on the front end after upload.

  3. lupetu
    Member
    Posted 11 months ago #

    I'm putting in another vote for this delete feature. Would be very useful

  4. julia227
    Member
    Posted 11 months ago #

    Is there a way to have uploaded files automatically post to a page?

  5. julia227
    Member
    Posted 11 months ago #

    How can I create a drop-down selection of different category types for when the user uploads a file? Thanks!

  6. lunatic4_u
    Member
    Posted 9 months ago #

    We want answers to above questions .. author should reply otherwise there is no use of this discussion page

  7. Rinat Khaziev
    Member
    Plugin Author

    Posted 9 months ago #

    Hey Daelorn,

    Currently there's no way to do so. What would be the use case for allowing users to delete files that they just uploaded?

    nicole2292,

    Currently there's no way to do so. It's planned for future releases though.

    julia227,

    For now you can only set one category via shortcode parameters.

    lunatic4_u,

    This is a free software that I develop and maintain whenever I have a spare minute, so telling what should I do is at least inconsiderate ;)

  8. Daelorn
    Member
    Posted 9 months ago #

    Hi Rinat,

    Thanks for your reply.
    Well, there can be several reasons:

    1. Uploaded wrong file
    2. Upload revised version
    3. Simply delete a file that is not actual anymore.

    We don't want the user to contact us each time they wish to delete one of their files.

  9. Rinat Khaziev
    Member
    Plugin Author

    Posted 9 months ago #

    Hey Daelorn,

    It's pretty easy to implement for registered users (because we could store uploader's id and that way add a relationship with the upload), but I'm not sure what would be a bulletproof solution for unregistered users. I could store a cookie indicating what uploads this user had made but it's not very reliable. I'm open to your ideas.

  10. Daelorn
    Member
    Posted 9 months ago #

    Well, I'm actually looking for a solution where only registered members can add/delete files, so I'm fine with the first.

    However, I'm not sure what the others want. Maybe you could have a look at the rtmedia plugin. They do it for images.

  11. Robin
    Member
    Posted 4 months ago #

    Hi there,

    Great plugin! Is it already possible to delete files from the front end? I would like this functionality too, for registered members.

    Thank you!

  12. Murilo Pinto Pereira
    Member
    Posted 2 months ago #

    Hi there!

    Its possible delete images in front-end.
    I got this with non-admin users.

    I use:
    in HTML:

    <a class="remImage" name="<?php echo $image->ID; ?>" href="#" onclick="delete_image(<?php echo $image->ID; ?>)"><?php _e('delete');?></a>

    JQuery

    function delete_image(id_image) {
    
        var attID = id_image;
        jQuery.ajax({
            type: 'post',
            url: '/wp-admin/admin-ajax.php',
            data: {
                action: 'delete_attachment',
                att_ID: id_image,
                _ajax_nonce: jQuery('#nonce').val(),
                post_type: 'attachment'
            },
            success: function() {
                console.log('#file-'+attID)
                $('#file-'+attID).fadeOut();
    			window.location.reload();
            }
    	});
    };

    in functions.php

    add_action( 'wp_ajax_delete_attachment', 'delete_attachment' );
    function delete_attachment( $post ) {
        //echo $_POST['att_ID'];
        $msg = 'Attachment ID [' . $_POST['att_ID'] . '] has been deleted!';
        if( wp_delete_attachment( $_POST['att_ID'], true )) {
            echo $msg;
        }
        die();
    }
  13. Robin
    Member
    Posted 1 month ago #

    Thank you so much!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags