Highlighted

How to Enable CORS in Adobe Campaign

badr_eddine

05-11-2019

Hi all,

so we wanted to add some new Fonts in our templates, but we couldn't, after some research we found that we need to enable CORS in our servers.

We have IIS servrer, so we looked into this documentation : https://enable-cors.org/server_iis7.html , but we couldn't find the web.config file.

The question here is where we can find that file inside the server? And if there isn't and we wanna create it, where exactly we can put the file ? Or if we can enable it using other way ?

Thanks,

Badr.

Replies

Highlighted

wodnicki

MVP

05-11-2019

Hi,

IIS uses the dir the site is being hosted out of for its web.config, akin to Apache's .htaccess file.

For your site, look at the url your fonts are hosted out of, then follow the same path in Windows Explorer; e.g. for http://example.com/res/fonts, the root is the parent of the res\fonts dir.

Thanks,

-Jon

Highlighted

badr_eddine

06-11-2019

Hi Jon and thanks for your answer,

The problem here is that I can't upload fonts to the delivery, shows me that error :

1851167_pastedImage_0.png

After i searched for that, I found a similar post that have more or less the same problem, where your answer was to enable CORS :

Using new font in AC templates 

I just wanna try to enable CORS to see if that the main problem, if it is, how i can enable CORS ?  

If not, how i can upload fonts to a delivery template in adobe campaign classic ?

Thanks,

Badr.

Highlighted

_Manoj_Kumar

MVP

06-11-2019

Hello Badr, Did you try upload your fonts under Resources > Online > Public Resources and use the url from there in the delivery template. It should work that way. Thanks, Manoj

Highlighted

badr_eddine

06-11-2019

Hi Manoj and thanks for your answer,

No, didn't work, we did try that too and keep loading without final result.

Thanks,

Badr.

Highlighted

_Manoj_Kumar

MVP

06-11-2019

Hello Badr, You can try this to enable CORS in server config file

<responseHeader name="" value="*.domain name"/>


Thanks, Manoj

Highlighted

somasundaramhal

06-11-2019

Hi,

From the screenshot above, seems like the font that you have uploaded, delivery is considering as an image. It should be font type and in Adobe campaign it will be considered as 'Other type' in file resources. As Manoj told, you can do following:

Then take the URL from public file resource and use in webapps. This works for us.

Note: For email, custom fonts might not work. Hope you know the limitations of email rendering in different email clients.

Thanks.

Highlighted

badr_eddine

07-11-2019

Hi,

Yeah i've tried the solution proposed by Manoj, but keeps loading without any final result, for a file of less than 30kb was on load more than 20 minutes.

Thanks,

Badr.

Highlighted

_Manoj_Kumar

MVP

07-11-2019

Hello Badr,

Did you try opening that font url directly in the browser? If the url is not loading for more than 20 minutes then there is a possibility that the DNS is not resolving.

And if the page is still loading then the CORS issue is solved, because the browser will immediately block the url request if the domain is not authorized for any request.

Thanks,

Manoj