I am stuck in my visualforce page where I am including script provide by google to achieve a Save button which below:
<script src="https://apis.google.com/js/platform.js"></script>
<div class="g-savetodrive"
data-src="https://www.yyy.com/file/path/abc.txt"
data-filename="My Statement.pdf"
data-sitename="My Company Name">
</div>
My Problem is this. When I am providing the url in "data-src" tag and click on button then my file is not upload in my drive I am getting "XHR error" because of different origin because my page loaded at https://www.xxx.com URL and the URL which I am providing in "data-src" is "https://www.yyy.com/file/path/abc.txt". I am assuming this problem is due to different origin.
Google has also provided some steps like put value in header like Access-Control-Allow-Origin: *
https://developers.google.com/drive/web/savetodrive#cors
But I don't know how can I achieve this.