File uploads in user account

Support MB User Profile File uploads in user accountResolved

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #33418
    synchrosynchro
    Participant

    Based on your previous help I tried to allow users (authors) to upload files to their account.

    1. I created one field "File Upload" to upload files for User location.
    2. After submission:
    • the file is in the media,
    • the standard (no title) post is created, and if I understand correctly the file must be attached to some post. Now can I actually choose where it is attached? I have a CPT called "Documents" so I'd like the attachments to go there, instead of going to posts.
    1. The uploaded file (by user) is not visible in the user back-end profile or in the front-end account page. However when I upload the file from the back-end (as admin) it becomes visible in both: front-end and back-end.

    So I'd need a bit of help with 2 (can I choose where the attachments go) and 3 (make them visible when user uploads them).

    Thanks a lot.

    #33419
    synchrosynchro
    Participant

    OK, ignore point 2 , I got it 🙂

    Just 3 I can't get it work.

    #33428
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I do not see that issue on my demo site. Can you please share the code that creates the field and some screenshots on your site?

    And please make sure that you have the latest version of Meta Box AIO 1.15.5 or MB User Profile 1.8.2

    #33448
    synchrosynchro
    Participant

    OK, so these are screenshots of my custom fields settings.

    https://asia.41.pl/wp-content/uploads/2022/01/1.png
    https://asia.41.pl/wp-content/uploads/2022/01/2.png
    https://asia.41.pl/wp-content/uploads/2022/01/3.png

    I created one field for file upload for users. So I test it and add that file as a user via the front-end form. And after submission I'd like that file to be displayed in the user account page. So I created a view to display that field and I inserted its shortcode into My Account template. But the file is not visible in the account. It is an entry in my CPT but not in the user profile. I thought if I enable custom fields location for users, the files will go to users profiles as well.

    And if I edit the user profile as an admin from the backend, and upload the file via the form directly from there, it is visible in the frontend in My account.

    I hope it's clear... 🙂

    #33450
    synchrosynchro
    Participant

    So I kind of know what I am doing wrong but I don't know how to fix it.
    How to make those attachments being saved in the user profile instead of any CPT?

    #33459
    Long NguyenLong Nguyen
    Moderator

    Hi,

    To allow the users to upload files on the frontend to their profile, you need to use the profile shortcode. Please read more on the documentation https://docs.metabox.io/extensions/mb-user-profile/#edit-profile-form

    [mb_user_profile_info id="meta-box-id" submit_button="Submit" confirmation="Your information has been successfully submitted. Thank you."]

    Here is the example: https://monosnap.com/file/XRr2i07B54v2lWHUJpIDs5B0dsuYzR

    #33461
    synchrosynchro
    Participant

    Ha, magic 🙂 Thank you.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.