File System Settings

Drupal offers two types of file downloading methods:

Public downloading: This means that the job of serving uploaded files to the browser falls on the underlying web server, which will serve them directly. Web servers are carefully optimized to be able to serve static resources like files in a very efficient way. This will always be the fastest method for offering downloads. The ramification is that the files must reside in a directory that is visible from the Web. Putting files in a Web-visible directory prevents you from having any control over who can download the file. Hotlinking— the practice of offering the URL to images or files on another server—will be possible, and depending on your goals, may not be desired. While some of these problems are addressable at the server administration level, it will never be possible for Drupal to control on a file-by-file basis whether or not a particular registered user can download something. To get that level of control, you will need to enable the private downloading method.

Private downloading: For the private downloading method to be effective, the files must reside in a directory that is not visible from the Web. The directory needs to be readable and writable by scripts, however, as PHP code will be responsible for putting the files into it and reading them out of it. In this scenario, the web server is never asked to serve the file directly. Instead, through use of a special URL, a PHP script is engaged to read the file in chunks and send the stream to the browser. Since the download is happening at the PHP level, code can be written to check if the current user actually has the permissions necessary to access the file. With greater control comes the cost of more server processing overhead and slower downloads.

The Download Method field in the File System Settings section determines which downloading method is to be used. Currently, you cannot combine these two methods, and changing methods on a live web site that already has uploaded content will break the existing links and is therefore strongly discouraged.

The File System Path setting is the path to the directory where uploaded files and images will be saved. How to address this directory depends on what setting you choose for Download Method. If you decide to use public downloads, you can use the standard files directory in the root of your Drupal installation. In this case, the value that you provide for the File System Path field is simply files. If you choose to use private downloads, you must provide a directory somewhere on your server that isn't visible to the Web, set the appropriate ownership and permissions on the directory so that it can be accessed via scripts, and provide the absolute or relative path to this directory.

The Temporary Directory setting is the path where uploaded files will be stored before they are handled by PHP scripts. This is typically /tmp on Linux machines.

0 0

Post a comment