heronyang / cloud-switch

Transfer your files between different cloud storage services.
2 stars 0 forks source link

Google Doc Issue #3

Closed inteltao closed 7 years ago

inteltao commented 7 years ago

In the Google Drive, there are types of files. One is the general files, the other is so called the Google Doc. Google will automatically transform the .doc, .xls, .ppt, .txt and other file types to Google Doc unless otherwise specified. If you try to download these files using API, you will have the following error.

403 Forbidden
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "fileNotDownloadable",
    "message": "Only files with binary content can be downloaded. Use Export with Google Docs files.",
    "locationType": "parameter",
    "location": "alt"
   }
  ],
  "code": 403,
  "message": "Only files with binary content can be downloaded. Use Export with Google Docs files."
 }
}

This makes the downloading process very difficult because in this case we can't differentiate the different file types and output the exact file format. (For example, .doc will mixup with .docx)

One possible way is to entirely ignore the google doc part

inteltao commented 7 years ago

Workaround: Identify the type by Mime type and export them as the corresponding type. Might not be exactly the type that the original file is