Google Drive: Automatically convert files on upload?

后端 未结 2 1952
忘掉有多难
忘掉有多难 2021-01-24 07:03

Is it possible to get Google Drive to automatically convert uploaded documents to the native format?

I know it works with manual upload

相关标签:
2条回答
  • 2021-01-24 07:29

    Using the API, you can pass the convert=true parameter to files.insert. The uploaded file will attempt to be converted to a native Google Docs format.

    0 讨论(0)
  • 2021-01-24 07:37

    Sure, see this answer. Note you can upload a text file or a csv file and set its content type to google doc or google sheets respectively, and google will attempt to convert it. I have tested this for text -> doc and it works. You will need to set the const contentType at the start of the code to one of the supported google mimetypes.

    0 讨论(0)
提交回复
热议问题