0

I'm trying to force the download of an image, that is hosted in the Content Builder, from a Cloud Page using JS.

Everything work properly if I use an image hosted on https://imgur.com/ but if I use an image hosted in the Content Builder i receive the following exception "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource..."

Do you have some idea on how to solve this?

2
  • 1
    It may be worth asking Support whether it's possible for SFMC to have OPTIONS requests enabled and CORS headers added to responses by Akamai. It's possible, with an OEM Akamai account, but I don't think it's possible for SFMC to enable this for you. It's worth asking. Can you alter the code that loads your images such that AJAX isn't making the request, but rather manipulate the DOM to add image tags? Would you consider using a proxy running on something like Heroku to act as an intermediary, accepting OPTIONS requests and adding CORS headers on the way through?
    – Macca
    Commented Jul 8, 2019 at 23:48
  • I could try to ask to the Support to enable CORS headers options, but i don't have enough time to wait the back and forth with them... i need to achive the result right now ;) Since we have an Akamai account for other contents i'll do that outside SFMC. Commented Jul 11, 2019 at 17:56

0

You must log in to answer this question.

Browse other questions tagged .