How to resumable upload with google drive node.js

我们两清 提交于 2019-12-01 12:41:11

In other api clients (e.g. the Python one), resumable uploads are created by altering the MediaFileUpload constructor with the parameter resumable=True. The node.js api client is only in alpha, so it may not have built-in support for resumable uploads. You can try feeding drive a stream, or simply extending that example media parameter, e.g.

media: {
  mimeType: 'some mimetype',
  body: 'some body',
  resumable: true
}

If stream and the above resumable don't work, then you won't be able to use the node.js client library to do resumable uploads, and will have to use the REST API directly.

The problem itself was related to the googleapi library for node.js. With v27.0.0 the basic upload was working again for big files aswell. Related to: https://github.com/google/google-api-nodejs-client/issues/1038

This is not an answer for how to resumable upload with node.js so you may keep this topic open until somebody post a sample code for resumable upload because even with v27 my POST request is still not working. Maybe you watch the github link from above because I asked there aswell for an sample code.

However my problem was only that I was not able to upload bigger files than 5MB. But this problem is now gone for me :)!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!