Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7684903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:08:00+00:00 2026-05-31T19:08:00+00:00

I need to develop a site on Drupal 7. I have some content types

  • 0

I need to develop a site on Drupal 7. I have some content types with File fields in CCK. And access to nodes of these types should be granted only to specific Drupal user role. And at any moment site administrator should be able to make these Nodes ‘public’ or ‘private’.

I can make nodes visible only to specific user roles, but this is not secure enough. If anonymous user knows the path to file ( http://www.mysite.org/hidden_files/file1 ), he can download it.

What is the most elegant way to solve this problem?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:08:02+00:00Added an answer on May 31, 2026 at 7:08 pm

    Check out this documentation here: http://drupal.org/documentation/modules/file

    Specifically, the section titled “Managing file locations and access” which talks about setting up a private data store (all supported by Drupal 7, it just needs to be configured).

    To paraphrase, create a folder such as:

    sites/default/files/private

    Put a .htaccess file in that folder with the following to prevent direct access to the files via the web:

    Deny from all

    (the documentation claims that the following step does the above steps automatically, I haven’t tested that unfortunately but you may be able to save some time if you skip the above two steps)

    Log into Drupal’s admin interface, go to /admin/config/media/file-system, configure the private URL and select Private Files Served by Drupal as the default download method.

    In order to define the fine-grained access to nodes and fields, you can use Content Access: http://drupal.org/project/content_access

    You will also need to edit your content types and set the file / image upload fields to save the uploaded files into Private Files instead of Public Files.

    At this point, the node and field level permissions will determine whether or not users are allowed to access the files which will be served through menu hooks that verify credentials before serving the file.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to develop a part of a Drupal web site. I cloned the
Im about to develop a site which will need 2 types of email function:
Some websites I develop have a great need for the use of Javascript, they
I need to develop a web site where I upload videos using the youtube
CodeIgniter is brilliant but I'm using it to develop a site where users need
I need to develop a CRM system which will allow users to have a
I need to develop a mobi site for a client, do I need a
Say I need to develop a web site for multiple browsers. major ones -
I need to develop an e-commerce site for my client. He wants it to
I need to develop a mid-sized Inernet facing web site (e.g. less than 1000

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.