Insert a file to a particular folder using google-drive-api

前端 未结 1 1091
一整个雨季
一整个雨季 2020-12-19 06:16

I tried as given below. But the file is going to root directory(My-Drive).

var metadata = {
  \'title\': fileData.fileName,
  \'mimeType\': contentType,
  \'         


        
相关标签:
1条回答
  • 2020-12-19 06:38

    I solved the issue.

    The error was in this line:

    'parents':["0B6NmmF3ovpsbExuOEc1R2JzSFEp"]
    

    The line should be:

    'parents':[{"id":"0B6NmmF3ovpsbExuOEc1R2JzSFEp"}]
    

    Documentation can be found at https://developers.google.com/drive/web/folder

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