CodeSteps

Python, C, C++, C#, PowerShell, Android, Visual C++, Java ...

Drupal 7 – How to set file system paths?

Drupal’s File module allows to upload and attach the files to content. The file module will use default locations to store and manage the files. Drupal allows you to set the locations where Drupal will store the files. Most of the time we can go with the default locations (file system paths) which are defined at the time of Drupal installation. But sometimes there will be a need like restrict access to files publicly; we need to set our own file system paths.

This article explains the steps to set file system paths in Drupal 7.

Step 1. Login to your Drupal-based website as an administrator.

Step 2. Click on the Configuration menu which is on top of the administration page. Drupal will display a Configuration page.

Drupal - Configuration page
Drupal – Configuration page

Step 3. Select File system link; which is under MEDIA group. Drupal will display the File system options page.

Drupal 7 - File System page
Drupal 7 – File System page

Step 4. On the File system page, enter the following:

  • Enter public file system path into Public file system path field. This is the location where Drupal will place public access files. These files can be accessed directly.
  • Set private file system path into Private file system path field. The files stored in this location are not accessible directly.
  • And the location of temporary files can be stored into the path mentioned in the Temporary directory field. This is the location where Drupal will store temporary files. Once you change this temporary directory path, Drupal will start using this updated temporary directory to store temporary files.

Step 5. Once you click on Save configuration to save your changes.

If you set a private file system path, upload a sample file into the private file system path and try to access the path through your web browser. Drupal should not allow you to access the file; if it allows, there should be an error. Resolve the error before publishing the site to the public. Otherwise, we can access the files stored in a private file system path; which should not happen.

**

Drupal 7 – How to set file system paths?

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top