I should upload an Excel file to a site that define a content type with a file CCK field; the download method is public. How do I set the permissions for the upload folder, if I would like to allow the PHP code to read this file, without to allow users to read this file using its URL? If the folder permissions don't resolve this problem, which module should I use?

1 Answer 1


If you want to prevent users from downloading the file directly by URL, you should not use the public download method. You should use the private method and use the functions in file.inc to access the files with PHP.

  • what if change upload folder permission to 750? users can read file?
    – user780
    Apr 20, 2011 at 7:59
  • 3
    The web server's user is the one who creates the files, and the web server's user will be the one who accesses the file in order to provide the download, so this approach will not work. Apr 20, 2011 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.