I'm trying to parse XLS files from Google Docs with PHP. It works fine when I manually download a file and then upload it to the server, but when I use PHP to save the exact same XLS file to the server directly, instead of getting all the data in the XLS, the response is:
<b>DOM ELEMENT: </b>HTML<br /><b>ATTRIBUTE: </b>lang => en<br /><b>DOM ELEMENT: </b>HEAD<br /><b>DOM ELEMENT: </b>META<br /><b>ATTRIBUTE: </b>charset => utf-8<br /><b>DOM ELEMENT: </b>META<br /><b>ATTRIBUTE: </b>content => width=300, initial-scale=1<br /><b>ATTRIBUTE: </b>name => viewport<br /><b>DOM ELEMENT: </b>META<br /><b>ATTRIBUTE: </b>name => description<br /><b>ATTRIBUTE: </b>content => Create a new spreadsheet and edit with others at the same time -- from your computer, phone or tablet. Get stuff done with or without an internet connection. Use Sheets to edit Excel files. Free from Google.<br /><b>DOM ELEMENT: </b>TITLE<br />
Here's an example of how I use PHP to save the XLS to the server:
$fileName = 'xls/newday2014.xls';
$xlsURL = 'https://docs.google.com/spreadsheets/d/1KKMiBOlvpKaAJ_MsNfaWGmR6ixL53AjAaLf0R18X3e4/edit#gid=161299136';
file_put_contents($fileName, file_get_contents($xlsURL));