Problems uploading images to media library

Support MB Frontend Submission Problems uploading images to media library

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #10093
    EddyPiVEddyPiV
    Participant

    Members of my site enter their details through Frontend Submission.
    I have problems uploading images, the error I get is that I am not authorised to attach files to this post (or something similar, the message is in Dutch).
    I am facing this problem for the following field types: Single Image, Image Advanced, File Advanced.
    I am not facing this problem for field types File Input and for Image Upload. Although the images end up in the WP media library, I'd like to give the option to choose an image that was uploaded before, next to uploading a new image.

    I have installed the WP Users Media plugin, so that users can only see their own uploaded images.
    Members have the rights of WP user role author.

    As administrator, I am not ancountering any problems uploading media files.

    Any suggestion?

    #10120
    Anh TranAnh Tran
    Keymaster

    If the author already have rights of author, can you try deactivating the WP Users Media plugin to check if the bug still happens?

    #10124
    EddyPiVEddyPiV
    Participant

    The same error occurs.

    #10233
    Anh TranAnh Tran
    Keymaster

    Hi,

    Can you please try this code in the docs, just to make sure your users have correct permission to upload images. Replace 'subscriber' in the snippet by your user role.

    #10239
    EddyPiVEddyPiV
    Participant

    Hi Anh,

    No, it doesn't make any difference. I have changed it as follows:

    function mb_allow_author_uploads() {
        if ( is_admin() ) {
            return;
        }
    
    // Replace 'subscriber' with the required role to update, can also be contributor.
    $author = get_role( 'author' );
    $author->add_cap( 'upload_files' );
    }
    add_action( 'init', 'mb_allow_author_uploads' );

    But same error message.
    My users have the author role, so should be capable of uploading their own images anyway, right?

    #10253
    EddyPiVEddyPiV
    Participant

    Update: I have installed the Frontier plugin (to add/edit the post in the frontend), and here it is allowed to upload images to the media library. But in ME Frontend Submission, it's not.
    Same user.

    Just for you to know. Hopefully this helps.

    #10275
    Anh TranAnh Tran
    Keymaster

    Hi, I've tested with lower role (subscriber) with the snippet above to allow it to upload images and it worked for me. Can you take a screenshot of the error? Or a screen record is perfect for debugging?

    #10370
    EddyPiVEddyPiV
    Participant

    Hi Anh, I don't know why, but it's working now smoothly.
    Strange..., but OK, I guess.

    Can you close this issue?
    Thanks

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Problems uploading images to media library’ is closed to new replies.