Custom Fields
Re-Envisioned
Support MB Frontend Submission Image upload does not work with MB Frontend Submission

  • Creator
    Topic
  • #6550
    ludovic.meyer
    Participant

    Hello,

    I use an image_upload in front but the loader keeps turning and the image never show.
    Looking a xhr request, i get an “Access denied” response

    
    array(
        'name'    => __( 'Poids max : 2Mo ; 72dpi ; Format min : 350×220px', 'vm' ),
        'id'      => 'vm_image',
        'type'    => 'image_upload',
        'max_clone' => 1,
        'max_file_size' => '2mb',
        'force_delete' => true,
    ),
    

    I tried other fields with no success.
    Do you have a solution ?

    Regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #6560
    Anh Tran
    Keymaster

    Hi,

    The problem with image upload in the frontend is permission. Users need to login and have the upload_files capability. WP doesn’t allow anonymous user to browse the media library and upload there.

    So, I’d suggest you use the simple image field, which allows uploading images, or you need to add more capabilities to allow users to upload (users still need to login though).

    #6600
    ludovic.meyer
    Participant

    Hi,

    My users are logged in as they are “subscribers”.
    I already set the upload_files capability via Advanced Access Manager before open the topic but the problem still remains.

    var_dump(current_user_can( ‘upload_files’ )); returns bool(true) but they can’t upload files.

    I also tried the simple image field with the same result (images are not uploaded).

    An idea ?

    #6606
    ludovic.meyer
    Participant

    You are right : simple image field works (but image_upload not, even with upload_files capability). But my field is in a group and it does not work.

    Please see : https://metabox.io/support/topic/fileimage-input-field-does-not-work-when-in-group/

    #6641
    Truong Giang
    Participant

    We will discuss in the topic: https://metabox.io/support/topic/fileimage-input-field-does-not-work-when-in-group/

    I’ll close this topic.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Image upload does not work with MB Frontend Submission’ is closed to new replies.

Newsletter

Subscribe to our newsletter to receive news and tutorials for Meta Box and WordPress.


grid gear info copy caret-up caret-down trash