Accessing a CSV file from another domain

214 Views Asked by At

A customer wants to display a list of addresses on his website (which changes regularily). The CMS behind that website does not offer any functions to do so. Also I can't access the file system behind that website and neither can i write server side code.

However, the customer has got another webspace we can use. So the best solution we came up with was that he just places a CSV file on his webspace which I can access and display from the original website via AJAX. But if I try to do that, i get the following error:

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

The customer isn't able to add this header. Is there any way i can access this CSV file OR any other solution i fail to see?

2

There are 2 best solutions below

0
On

You could embed around (maybe via a simple php file) a jsonp like function call and embed the file with simple script tags.

2
On

You can have the customer save the address list as an image, which can be hotlinked without the cross-origin policy getting in the way.

Alternatively you can explain to the customer that you're not a wizard, and need a modicum of accommodation so that you actually can do your job. Would you ask your mechanic to repair your car without giving access to the engine?