質問編集履歴

2

先ほど直した時に実行したらエラーが変わっていたのでエラー内容を更新しました。

2023/09/25 21:35

投稿

Programming
Programming

スコア5

test CHANGED
File without changes
test CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  ```
13
13
  Exception: Request failed for https://www.googleapis.com returned code 400. Truncated server response: Invalid request. There were 5242881 byte(s) (or more) in the request body. There should have been 5242880 byte(s) (starting at offset 0 and endin... (use muteHttpExceptions option to examine full response)
14
- test2 @ コード.gs:55
14
+ test2 @ コード.gs:58
15
15
  ```
16
16
 
17
17
  ### 該当のソースコード

1

16–17行目が抜けていたので足しました

2023/09/25 14:56

投稿

Programming
Programming

スコア5

test CHANGED
File without changes
test CHANGED
@@ -31,7 +31,10 @@
31
31
  "X-Upload-Content-Type": file.getMimeType(),
32
32
  "X-Upload-Content-Length": file_size
33
33
  },
34
- payload: JSON.stringify()
34
+ payload: JSON.stringify({
35
+ title: file.getName(),
36
+ mimeType: file.getMimeType()
37
+ })
35
38
  }).getHeaders()["Location"];
36
39
 
37
40
  for(let i = 0; i < chunks; i++) {