Cross domain display image in SharePoint apps

%3CLINGO-SUB%20id%3D%22lingo-sub-1974922%22%20slang%3D%22en-US%22%3ECross%20domain%20display%20image%20in%20SharePoint%20apps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1974922%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20SharePoint%20hosted%20app%2C%20we%20have%20multiple%20images%20which%20refers%20to%20URL%20of%20SP%20Host%20site%20Image%20library.%20On%20Page%20load%2C%20browser%20does%20not%20load%20the%20image%20because%20of%20cross%20domain%20restrictions.%3C%2FP%3E%3CP%3EAlso%2C%20tried%20ajax%20call%20to%20fetch%20image%20encoded%20base-64%20from%20Host%20site%20library%20but%20we%20are%20facing%20performance%20issue%20in%20that.%3C%2FP%3E%3CP%3EIs%20there%20any%20other%20way%20to%20display%20the%20cross%20domain%20Image%20in%20SharePoint%20hosted%20app.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1974922%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApp%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

In SharePoint hosted app, we have multiple images which refers to URL of SP Host site Image library. On Page load, browser does not load the image because of cross domain restrictions.

Also, tried ajax call to fetch image encoded base-64 from Host site library but we are facing performance issue in that.

Is there any other way to display the cross domain Image in SharePoint hosted app.

1 Reply

@Ashish_Rohilla Hello,

I would recommend using Azure blob storage + CDN, if that could be a possibility for your solution.
Through CDN, you can configure CORS rules and allow certain domains.

Yours sincerely,
Aref Halmstrand