You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the user adds a link to a remote CSV file, we were getting CORS Access to XMLHttpRequest at 'file url' from origin 'null' has been blocked by CORS policy: Request header field range is not allowed by Access-Control-Allow-Headers in preflight response.
To resolve this, I have used a CORS proxy
function receive(data){ console.log(data,"data"); } function func(){ var data=[] const proxyurl = "https://cors-anywhere.herokuapp.com/"; const url = "http://insight.dev.schoolwires.com/HelpAssets/C2Assets/C2Files/C2ImportCalEventSample.csv"; fetch(proxyurl + url) .then(response => response.text()) .then(contents => receive(contents)) .catch(() => console.log("Can’t access " + url + " response. Blocked by browser?")) }
This seems to work fine. What do you think, @jywarren ?
The text was updated successfully, but these errors were encountered:
When the user adds a link to a remote CSV file, we were getting CORS
Access to XMLHttpRequest at 'file url' from origin 'null' has been blocked by CORS policy: Request header field range is not allowed by Access-Control-Allow-Headers in preflight response.
To resolve this, I have used a CORS proxy
function receive(data){ console.log(data,"data"); } function func(){ var data=[] const proxyurl = "https://cors-anywhere.herokuapp.com/"; const url = "http://insight.dev.schoolwires.com/HelpAssets/C2Assets/C2Files/C2ImportCalEventSample.csv"; fetch(proxyurl + url) .then(response => response.text()) .then(contents => receive(contents)) .catch(() => console.log("Can’t access " + url + " response. Blocked by browser?")) }
This seems to work fine. What do you think, @jywarren ?
The text was updated successfully, but these errors were encountered: