Recently we got the below error when we tried to download and zip the files from within CRM’s Web Resource. The files were stored in Azure Blob Storage. We were using JSZipUtils for it.

Access to XMLHttpRequest at ‘https://abcnon…..’ from origin ‘https://abc-dev-abc.crm6.dynamics.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
BlobAttachmentPreview.js:663 Uncaught Error: InvalidStateError: Failed to read the ‘responseText’ property from ‘XMLHttpRequest’: The value is only accessible if the object’s ‘responseType’ is ” or ‘text’ (was ‘arraybuffer’).
at f.onreadystatechange (jszip-utils.min.js:1:1544)
As we can see in the details, the error turned out to be the CORS issue.
Mistakenly we had the forward slash added to end of the URL specified in the Allowed origins.

Before – https://abc-dev-abc.crm6.dynamics.com/
After – https://abc-dev-abc.crm6.dynamics.com
Removing the slash at the end fixed the issue, as the Azure Blob Storage CORS rules typically require exact matching for allowed origins.
Hope it helps..









