error 403 when loading my own kml-file

Hi,

I'm quite new to Cesium (I'm impressed) and would like to load my own kml-file 'MyKML.kml' which results in the error message 'Request has failed. Status Code: 403'. The same kml-file loads fine e.g. in Google Maps Pro. Here is the code:

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.KmlDataSource
    .load('../../SampleData/kml/MyKML.kml', {
        camera: viewer.camera,
        canvas: viewer.canvas
    })
)
.then( function (dataSource) {
    viewer.flyTo(dataSource.entities);
});

Running the same code example with the 'bikeRide.kml' file provided by Cesium (tutorial) works fine:

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.KmlDataSource
    .load('../../SampleData/kml/bikeRide.kml', {
        camera: viewer.camera,
        canvas: viewer.canvas
    })
)
.then( function (dataSource) {
    viewer.flyTo(dataSource.entities);
});

I'm running Cesium in a Mac Safari browser, and the two kml-files show the same permission/access rights. What am I doing wrong? Thank you for advise!
Guido

Hello Guido,

Glad to see your interested in Cesium! A 403 error usually means that the server isn’t giving you permission to read that file.

How are you running the application? In order to add your kml file to the application, the file needs to be accessible by whatever server is running the application. Check out our getting started tutorial for how to download the library and run a server locally: http://cesiumjs.org/tutorials/cesium-up-and-running/

Best,

Hannah