function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Prasobh V 4Prasobh V 4 

No 'Access-Control-Allow-Origin' header is present on the requested resource.

Hi All,

I am trying to load a .stl file on visualforce page by embedding JS based .stl viewer.
.stl file is actually located in AWS S3. And when I try to access it, I am getting below error.
XMLHttpRequest cannot load https://s3.amazonaws.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://c.na29.visual.force.com' is therefore not allowed access.

Will enabling CORS at the server side will solve the issue? Is there any other way to solve this issue?
Is there any security issues on doing the same which can affect my security review while I publish app?
ShashankShashank (Salesforce Developers) 
Please see if this helps: http://salesforce.stackexchange.com/questions/51193/xmlhttprequest-cannot-load-no-access-control-allow-origin-is-present
Talha SaqibTalha Saqib
Please try the following resource: https://retrology.net/how-to-fix-no-access-control-allow-origin-header-is-present-on-the-requested-resource-error-in-apex-salesforce/