How to get drupal 7 default file upload directory?
original source : http://drupal.stackexchange.com/questions/61028/how-to-get-drupal-7-default-file-upload-directory
This information is saved in Drupal’s variables table. Use the
variable_get function to get this information, passing in the name of the correct variable:
- Public Filesystem Location:
variable_get('file_public_path', conf_path() . '/files');
- Private Filesystem Location:
If you want the temporary upload directory use
variable_get('file_temporary_path'); If you want to determine the system specific upload directory, regardless of the actual site configuration use the
variable_get('file_public_path', conf_path() . '/files'); will pull the default path for you in case it has not been modified or explicitly set by the site administrator.