0

My images are saved in folder

sites/all/default/files/styles/large/public/field/image

But to make this future save i dont want to hardwire the path? Is there a drupal function to get the images in a proper way? I played around with

image_style_url(uri)

But i just need the default dir to pass it to javascript, I dont have image uris yet...

Thanks a lot!

1 Answer 1

1

I'm not sure this will get you exactly what you want, but the 'default' path is just public://, so.

$url = image_style_url('large', 'public://');

will return

http://yoursite.com/sites/default/files/styles/large/public

I think it's more likely you're looking for a specific path, e.g.

$url = image_style_url('large', 'public://field/image');

which returns

http://yoursite.com/sites/default/files/styles/large/public/field/image
0

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.