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
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?– user780Commented Apr 20, 2011 at 7:59
-
3The 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. Commented Apr 20, 2011 at 15:03