I need to pass some URLs to user pictures via AJAX. I can't, however, pass private://filename.jpg because client can't open it. Are there some settings to configure where I can change to public space?

2 Answers 2


You need to change the image field associated with the user profile to Public, and then you need to migrate any existing private image files to the new public directory. Here's a write-up on working with files in Drupal 7.


I think you usefile_create_url() to turn your URI into a public URL:

$path = 'private://test/test.jpg';
print file_create_url($path);

The above prints http://site.com/system/files/test/test.jpg.

This still means that visiting user should have permission to view that file (as it's a drupal private file).

If thats not true Lester Peabody's answer look good

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.