Code snippet
Retrieve a full-sized image for a single record
Copy it with the button on the code. For the why and the walkthrough, see “How to retrieve Image columns using Power Pages’ Portal Web API”.
webapi.safeAjax({
type: "GET",
url: "/_api/musdyn_tracks({{request.params.id}})/musdyn_artwork?size=full",
contentType:"application/json",
success: function(res) {
$('body').append('<img class="img-responsive" src="data:image/png;base64,' + res.value + '">');
},
error: function(xhr, status, error){
$('body').append('<img class="img-responsive" src="/artwork-not-found.svg">');
var errorMessage = xhr.status + ': ' + xhr.statusText;
console.log(errorMessage);
}
});