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.

[mepr-user-file slug="mepr_drivers_license" userid="5521"] will generate a link to the file uploaded by the user with ID 5521 with the slug as the clickable Link Text name. The link will open the file in a new tab.
[mepr-user-file slug="mepr_drivers_license"]Download[/mepr-user-file] will generate a link to the file uploaded by the currently logged in user with the text in-between the shortcodes (Download) as the clickable Link Text name. The link will open the file in a new tab.
If you want to add a link to the file in an email, you can use the {$usermeta:slug} email param, just replace "slug" with the slug of the file field like so:  {$usermeta:mepr_drivers_license} 
Members can replace their file(s) from their Account page if you've allowed the "Show in Account" option when creating the File Upload field in MemberPress > Settings > Fields 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"
For advanced users, if you wish to alter these, you can make use of our WordPress PHP filter  mepr_upload_mimes as shown below. You can add the code snippet using a plugin like the WPCode plugin (set the snippet to Run Everywhere). Please check this article for details: How to add custom code snippets in WPCode.
// Allow PDF uploads
function alter_mepr_upload_mimes($mimes) {
  $mimes['pdf'] = 'application/pdf';
  return $mimes;
}
add_filter('mepr_upload_mimes', 'alter_mepr_upload_mimes');
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.