1

Recently I've integrated Google Drive with my iOS application. Everything works fine but .ppt files. Normally if a file is a Drive file I use downloadURL to download it. If the file belongs to Google Docs I use one of the exportLinks (exactly the same as Alain described it here).

However all .ppt files (with "mimeType": "application/vnd.google-apps.presentation") which come from Google Docs are corrupted after being downloaded (I use an export link with exportFormat=pptx). The same file downloaded via web browser works fine. I use ASIHTTPRequest lib for downloading files (which also can be the reason of corrupted .ppt?).

Any ideas why only ppt files cause problems?

Community
  • 1
  • 1
lechec
  • 839
  • 1
  • 8
  • 17
  • The actual file exported should be "pptx", not "ppt", can you confirm this? – Ali Afshar Jul 25 '12 at 18:45
  • Yes, I confirm. So even is my file name is presentation.ppt (in Google Docs), after download its name becomes presentation.ppt.pptx – lechec Jul 25 '12 at 19:55

1 Answers1

2

I can already tell you that the lib you're using isn't the cause:I'm not using it but I've the same problem: it seems that there the code received isn't 200 (if ($httpRequest->getResponseHttpCode() == 200)) as it shows me a specific error message I've asked to return in case of. Also, when I'm trying to download a presentation in PDF or txt, it shows the same error.

It's not really an answer but I'm trying to understand also why only presentations are causing problems.

EDIT: the code received is 302. If it can help... EDIT 2: After trying, I noticed that the first parameter is the file id and the second the export format:

https://docs.google.com/feeds/download/presentations/Export?docId=filedid&exportFormat=pptx

But in the 302 code, I have this location:

https://docs.google.com/feeds/download/presentations/Export?exportFormat=pptx&id=fileid

Not only the two parameters aren't in the same order but the name is id and not docid

When I take this URL, put it as the export link and then try to copy the file, it's working. I get a 200 response and the inside of the file.

I hope it helps.

vicrabb
  • 190
  • 1
  • 14
  • When I replaced docId with id it started working. The order of the parametrs doesn't matter. I had to make this replacement only for export links ending with exportFormat=pptx – lechec Jul 27 '12 at 19:45
  • Yeah I know, that's why I have put the difference of the name in bold after realizing that it wouldn'nt be a question of order (but I let the observation though). Glad to see it's working for you too. – vicrabb Jul 28 '12 at 05:40