How to allow Members to upload files
MemberPress allows you to specify a handful of different custom field types that a member must fill out when registering for a Membership account on your website.
In some cases, you may want to review some documents from the user prior to approving their membership on your site.
To do this, simply create a new File Upload Custom Field type like shown below:
Now on your registration form(s) for your Membership(s), there will be a new field where the member can upload a document.
After the member has registered, you (as an admin user) can view the user's uploaded file within their WordPress User Profile as shown below:
Note: Additionally to this, user's uploaded files are stored within the the wp-content/uploads/mepr/userfiles/ folder
Clicking View will open the file or download it, depending on how your browser is set to handle that particular file type.
Clicking Replace will allow you to upload a different file instead.
By default, MemberPress does not allow the member to know the location or view the uploaded file for security reasons. This is to prevent bots from registering and uploading then executing malicious code.
But if you want to allow your members to view the files they've uploaded, the following shortcode(s) can be used:
[mepr-user-file slug="mepr_drivers_license"] will generate a link to the file uploaded by the currently logged in user with the slug as the clickable Link Text name. The link will open the file in a new tab.
MemberPress only supports uploads of the following types:
"jpg|jpeg|jpe" => "image/jpeg", "gif" => "image/gif", "png" => "image/png", "tiff|tif" => "image/tiff", "txt|asc|c|cc|h|srt" => "text/plain", "csv" => "text/csv", "rtx" => "text/richtext", "zip" => "applicat /ion/zip", "doc" => "application/msword", "pot|pps|ppt" => "application/vnd.ms-powerpoint", "xla|xls|xlt|xlw" => "application/vnd.ms-excel", "docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "pptx" => "application/vnd.openxmlformats-officedocument.presentationml.presentation", "odt" => "application/vnd.oasis.opendocument.text", "odp" => "application/vnd.oasis.opendocument.presentation", "ods" => "application/vnd.oasis.opendocument.spreadsheet"
// Allow PDF uploads function alter_mepr_upload_mimes($mimes) { $mimes['pdf'] = 'application/pdf'; return $mimes; } add_filter('mepr_upload_mimes', 'alter_mepr_upload_mimes');