File uploads in user account
Support › MB User Profile › File uploads in user accountResolved
- This topic has 6 replies, 2 voices, and was last updated 3 years, 2 months ago by
synchro.
-
AuthorPosts
-
January 24, 2022 at 12:28 AM #33418
synchro
ParticipantBased on your previous help I tried to allow users (authors) to upload files to their account.
- I created one field "File Upload" to upload files for User location.
- 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.
- 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.
January 24, 2022 at 1:01 AM #33419synchro
ParticipantOK, ignore point 2 , I got it 🙂
Just 3 I can't get it work.
January 24, 2022 at 4:26 PM #33428Long Nguyen
ModeratorHi,
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
January 25, 2022 at 8:33 PM #33448synchro
ParticipantOK, 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.pngI 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... 🙂
January 25, 2022 at 8:46 PM #33450synchro
ParticipantSo 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?January 26, 2022 at 12:03 AM #33459Long Nguyen
ModeratorHi,
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
January 26, 2022 at 1:23 AM #33461synchro
ParticipantHa, magic 🙂 Thank you.
-
AuthorPosts
- You must be logged in to reply to this topic.