CORS in Box API
Box provides simple storage of files, which may be shared via view/download
links. The Box API supports CORS on an app-by-app basis. Contact the Box team with a description of your use case so that they can allow access from your local domain when making the CORS request. They provide an example of an Ajax upload using jQuery:
// Set up the multipart form using HTML5 FormData object var form = new FormData(); // The content of the file // The file content could be read via jQuery.get() var fileBody = '<p>hey!<p>'; // JS file-like object var blob = new Blob([fileBody], { type: 'text/xml'}); // Add the file to the form form.append('file', blob); // Add the destination folder for the upload to the form form.append('parent_id', '0'); var uploadUrl = 'https://upload.box.com/api/2.0/files/content'; // The Box OAuth 2 Header. Add your access token. var headers = { Authorization: 'Bearer YOUR_ACCESS_TOKEN' // your Box API Access Token }; $.ajax({ url: uploadUrl...