User login

Drupal function to give path to files directory

All Agaric wanted was the Drupal function to give the path to files directory (which Drupal core itself should probably use instead of embedding the full filepath in the files database), and finding it was soooooo much harder to find than it should have been.

The Drupal function which we suppose we ought to use is file_create_url().

See http://api.drupal.org/api/function/file_create_url/5

Which will work even if the file system is made private

See also:

http://api.drupal.org/api/function/file_directory_path/5
http://api.drupal.org/api/function/file_create_path/5

Reference

Here's the article I was trying to find:

Handling of public and private files in Drupal
http://symbiotix.net/articles/handling-public-and-private-files-drupal

Resolution

Searched words: 
path to users' uploaded files in drupal drupal public files function drupal public files function warning drupal public private files function drupal call files public private safe file handling drupal public private drupal file save trouble do you know a function to get the path to a Drupal site's files directory? path to files () ?? nope

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.