| 72 | } |
| 73 | |
| 74 | private async updateFile(content: string | Blob): Promise<void> { |
| 75 | const myHeaders = new Headers(); |
| 76 | myHeaders.append("Content-Type", "application/octet-stream"); |
| 77 | myHeaders.append( |
| 78 | "Dropbox-API-Arg", |
| 79 | JSON.stringify({ |
| 80 | path: this.path, |
| 81 | mode: "overwrite", |
| 82 | autorename: false, |
| 83 | }) |
| 84 | ); |
| 85 | |
| 86 | await this.fs.request("https://content.dropboxapi.com/2/files/upload", { |
| 87 | method: "POST", |
| 88 | headers: myHeaders, |
| 89 | body: content instanceof Blob ? content : new Blob([content]), |
| 90 | }); |
| 91 | |
| 92 | return Promise.resolve(); |
| 93 | } |
| 94 | |
| 95 | private async createNewFile(content: string | Blob): Promise<void> { |
| 96 | const myHeaders = new Headers(); |