Skip Navigation

[Resolved] Secure uploads

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to restrict access to the media elements when navigated to from a direct url. Example https://mysite.eu/wp-content/uploads/2018/03/contract.pdf

Solution:

What you can do is to follow the instructions in the link below and it should be able to help you restrict this.
http://www.wpbeginner.com/plugins/how-to-restrict-media-library-access-to-users-own-uploads-in-wordpress/

This support ticket is created 6 years, 1 month 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)

This topic contains 8 replies, has 2 voices.

Last updated by Tiit Sau 6 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#623633

How to secure file access uploded by user?

#623720

Shane
Supporter

Languages: English (English )

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

Hello,

Thank you for contacting our support.

What do you mean by secure uploads? The items that are uploaded are completely dependent on wordpress own privacy that it uses to secure its uploads.

Thanks,
Shane

#624042

Users have custom fields for document uploads.
Now i wish to hide the file from public as they are by default
hidden link.
Only logged in users allowed to access own files.

#624242

Shane
Supporter

Languages: English (English )

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

Hello,

What you can do is to use our Access plugin to manage the media gallery by setting the permissions so that the users won't be able to preview other's media items.

Please let me know if this helps.
Thanks,
Shane

#625153

Hi,

Access Control -> Post Types -> Media objects> .. can only manage media-element pages, not files :
"This section controls access to media-element pages and not to media that is included in posts and pages."

In Access documentation i find only this:
"Please note that since the Access version 2.3.2, it is not possible to add items belonging to the Media (attachments) post type, to the Post groups." - So can't manage with Post Groups also.

Any ideas leaft?
Thanks
Tiit

#625318

Shane
Supporter

Languages: English (English )

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

Hello,

I was able to do a short search for a suitable solution for you and stumbled upon the document below.
hidden link

This should be able to help resolve the issue for you.

Thanks,
Shane

#625526
not-to-media.png
author-files.png

Thanks Shane,

Referred solution handles access to media library, but our customized users do not have access to media library and to WP backend at all. Users can upload files thru CRED form only. Now i'm tryng to restrict direct access to files, located in /wp-content/uploads, for everyone except author and administrator(image 1).

There is a pretty nice preview of possibilities to resolve the case with Toolset Access(image 2), but does not do it all.
"This section controls access to media-element pages and not to media"

With regards,
Tiit

#625689

Shane
Supporter

Languages: English (English )

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

Hello,

Yes I understand what you are trying to achieve but this is outside of what our toolset access plugin can achieve. The note you highlighted means that it restricts access to the media element page
Example if you go to the media library and click on an image then click view attachment page then this is what will be restricted.

You won't be able to restrict the files per user but you can restrict it for all by following the solution in the link below.
https://stackoverflow.com/questions/19286753/login-required-to-view-media-file-uploaded-to-wordpress

Thanks,
Shane

#625715

Thanks Shane!

This is almost what i just did - restricted direct access to uploads for all not logged in users. Will looking forward for custom solution, as it have to be by project.

Have a nice weekend,

Tiit

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.