Ahoy all!

So, long story short, I'm uploading files to drupal through services from an angular app, and getting a response/url/etc no problem. My question is, how do I enable image styles to be created on REST upload from services? I'm receiving an empty response in the image_styles array. I am assuming it likely isn't something I need to add into the POST request, but happy to add POST request code if needed.

I am coming up a little short on my google-fu on this one, and any help appreciated!

Screenshot of REST Response, file upload drupal services


the image created with the style when you request a page displaying that image_style So you have to call it in code.

The default generation method only creates images when they are requested by a user's browser.

image_style_url Returns the URL for an image derivative given a style and image path

code sample :

// $file object from file_load($fid) 
image_style_url('style name', $file->uri)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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