How to resumable upload with google drive node.js

后端 未结 2 1179
说谎
说谎 2021-01-16 06:42

Hey since google drive was changing their library I´am not able to upload anymore files bigger than 5MB with the basic upload drive.files.create. The docs t

2条回答
  •  一个人的身影
    2021-01-16 07:28

    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.

提交回复
热议问题