Skip Navigation

[Resolved] Adding a prefix to file names when uploaded by a user

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Shane 4 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1933479

I use memberpress to create memberships, members can upload files to share with other members in a document library, but currently if someone has the url of the file (it is in the wp-content/uploads folder) then they can access it without being members.

There are two options. I can use memberpress downloads plugin (but I am having trouble creating a form that works with this as the files are stored in a different folder) Or I can protect membership content using a prefix with each file. This limits access according to rules I can set up with memberpress.

I think the simplest way would be for me to add a prefix to the file when it gets uploaded based on a taxonomy that they select when they upload it in the form. This then automatically protects the files from being accessed directly.

Is this possible using forms?

#1934129

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ben,

Thank you for getting in touch.

This is something that is possible to achieve however, it will need to be done with custom code.

Unfortunately the custom code required to achieve this is out of the scope of our support forum as such I wouldn't be able to provide much assistance here.

Thanks,
Shane