cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

CORS Access-Control-Allow-Origin

Explorer | Level 3

Hey guys, so i have this angular script to pull in a json file I'm storing in Dropbox. my current issue is that I get an Access-Control-Allow-Origin error every time. I'm not really sure how to fix it... 

    <script type="text/javascript">
        var app = angular.module("mig-usedgear", [])
        app.controller("myCtrl", function($scope, $http) {
            $http.get("http://www.dropbox.com/s/8g7fump2tnbohv2/items.json?raw=1")
                .then(function(response) {
                    $scope.friends = response.data;
                });
        });
    </script>
1 Reply 1
Highlighted

Re: CORS Access-Control-Allow-Origin

Dropboxer
Dropboxer

The 'www.dropbox.com site' doesn't allow CORS like this. 

You can technically make this work using 'dl.dropboxusercontent.com' (e.g., "http://dl.dropboxusercontent.com/s/8g7fump2tnbohv2/items.json"), but please note that isn't officially supported.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?