fry2010 Posted March 14, 2012 Share Posted March 14, 2012 Ok, my issue is that when using cURL to download a request to google docs, using cURL option file transfer, it downloads immediately. This means that all I really end up saving is a loading screen. So I guess my question is, is there a way to make cURL wait untill the page at google docs is complete? Or is there a better solution? I basically want to store a local copy of what google docs produces, so next time a user needs to view that document, they dont have to wait for loading time. Here is curl request im using: // Download the file from google docs $fh = fopen(DIR_DOWNLOAD . '/database/' . $fileName . '.html', 'w'); $ch = curl_init($docsFile); curl_setopt($ch, CURLOPT_FILE, $fh); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_exec($ch); print_r(curl_getinfo($ch)); curl_close($ch); fclose($fh); Quote Link to comment https://forums.phpfreaks.com/topic/258888-curl-download-google-docs/ Share on other sites More sharing options...
trq Posted March 14, 2012 Share Posted March 14, 2012 Have you looked at Google's API's? Quote Link to comment https://forums.phpfreaks.com/topic/258888-curl-download-google-docs/#findComment-1327168 Share on other sites More sharing options...
cpd Posted March 14, 2012 Share Posted March 14, 2012 Out of interest, why would you want to download a google doc using cURL when there is a method in the Google Documents List API? Quote Link to comment https://forums.phpfreaks.com/topic/258888-curl-download-google-docs/#findComment-1327169 Share on other sites More sharing options...
fry2010 Posted March 14, 2012 Author Share Posted March 14, 2012 mmk, I failed to spot that looking at google docs, rather than their API. Will have look through that, thanks. btw if any of you know of the method I should use that would be handy, otherwise Ill have a good look through. cheers. Quote Link to comment https://forums.phpfreaks.com/topic/258888-curl-download-google-docs/#findComment-1327192 Share on other sites More sharing options...
fry2010 Posted March 14, 2012 Author Share Posted March 14, 2012 Can someone advise, the way I need to use the API is basically like this: I will be setting a cron job to send a bunch of documents to google docs to parse them I then want to retrieve the documents that google has parsed into images, i imagine using the download document method in the API. However, googles documentation on obtaining an OAUTH token falls short here. Can someone point me to an example of requesting an OAUTH token to my own account? If I even need that? I have the access key etc, but knowwhere does it explain how I actually permit myself access, at least I cant find it. Quote Link to comment https://forums.phpfreaks.com/topic/258888-curl-download-google-docs/#findComment-1327214 Share on other sites More sharing options...
fry2010 Posted March 14, 2012 Author Share Posted March 14, 2012 Ok I don't think what I want to do is possible with google API docs. Basically I want to display .doc, .docx etc files in the browser, with all the same formatting. So googles API doesnt have anything for the viewer from what I can tell. Quote Link to comment https://forums.phpfreaks.com/topic/258888-curl-download-google-docs/#findComment-1327249 Share on other sites More sharing options...
Muddy_Funster Posted March 14, 2012 Share Posted March 14, 2012 I think that's outwith the terms of service for your google docs account, have you looked at LiveDOCX? it's pretty much designed for what you want to do. Quote Link to comment https://forums.phpfreaks.com/topic/258888-curl-download-google-docs/#findComment-1327255 Share on other sites More sharing options...
cpd Posted March 14, 2012 Share Posted March 14, 2012 https://docs.google.com/viewer You realise google have their own format for documents? It's not a simple .doc format. I was at a google event in London recently where they explained all their future plans etc and how they want to hold everyone's documents in a central location. Quote Link to comment https://forums.phpfreaks.com/topic/258888-curl-download-google-docs/#findComment-1327257 Share on other sites More sharing options...
Muddy_Funster Posted March 14, 2012 Share Posted March 14, 2012 https://docs.google.com/viewer You realise google have their own format for documents? It's not a simple .doc format. I was at a google event in London recently where they explained all their future plans etc and how they want to hold everyone's documents in a central location. yeah, and not just their documents either....muhahahaha! Quote Link to comment https://forums.phpfreaks.com/topic/258888-curl-download-google-docs/#findComment-1327260 Share on other sites More sharing options...
cpd Posted March 14, 2012 Share Posted March 14, 2012 It wouldn't surprise me but they were reluctant to discuss anything other then their docs at this particular event. I did question however, what would happen if - in the very unlikely and possibly impossible - google crashed and burned. Every-bodies documents would go Quote Link to comment https://forums.phpfreaks.com/topic/258888-curl-download-google-docs/#findComment-1327267 Share on other sites More sharing options...
Muddy_Funster Posted March 14, 2012 Share Posted March 14, 2012 I'd be more concerned with the more plausable "what happens to the information if Google sells out to or merges with A. N Other company"? what protection do users have against said company accessing and using documentation that is stored on googles servers? anyway, hijack incident over I think, everyone can go back to their normal routine, move along, nothing to see here.... Quote Link to comment https://forums.phpfreaks.com/topic/258888-curl-download-google-docs/#findComment-1327269 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.