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
prasanth krishna 20prasanth krishna 20 

Lightning Ajax REST Callout Error..!!

Hi,

I am developing an application in Lighting, The functionality of that app is sending a file to Amazon s3 for that I am using AJAX after choosing a file from input type file in HTML, But lighting is not allowing me to connect to Amazon S3. I am getting below error message in console.
 
Refused to connect to 'https://s3.amazonaws.com/CloudFilesDemo/' because it violates the following Content Security Policy directive: "connect-src 'self' https://api.bluetail.salesforce.com https://staging.bluetail.salesforce.com https://preprod.bluetail.salesforce.com".

statusText: "SecurityError: Failed to execute 'open' on 'XMLHttpRequest': Refused to connect to 'https://s3.amazonaws.com/CloudFilesDemo/' because it violates the document's Content Security Policy


Could you please suggest me anyway to achieve this.

Thanks.
Jean Luc RaesJean Luc Raes
Hello Krishna,
I have the same problem now. Have you found a solution or workaround for this in the meantime ?

Thank you in advance,
Jean-Luc
prasanth krishna 20prasanth krishna 20
Hi Raes,

I found a workaround for this, you can use a intermediate visualforce page to handle the request and response from salesforce to amazon. And Use this page in IFrame from Lightning Component. And Create a Register Event.