Is it possible to get a byte array of an image stored in Tridion using the Anguilla JavaScript API? I would like to display an image in a GUI extension popup window.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The easiest way I can think of is by simply loading the MMC using a URL like this:
If you use that approach the actual loading of the bytes has nothing to do with Tridion anymore: you’re just loading an image from a URL.
You’ll probably want to construct the URL in JavaScript, so start with something like this (which I shamelessly copied from the source code):
Update
As usual the Mozilla Developer Connection has a great example on loading binary data with XMLHttpRequest. Applied to this situation, I seem to get the data with this snippet: