* Write file to ftp server * @param {string|ArrayBuffer} content * @returns
(content = "")
| 140 | * @returns |
| 141 | */ |
| 142 | async writeFile(content = "") { |
| 143 | await this.#connectIfNotConnected(); |
| 144 | const localFile = this.#cacheFile; |
| 145 | await internalFs.writeFile(localFile, content, true, false); |
| 146 | |
| 147 | return new Promise((resolve, reject) => { |
| 148 | ftp.uploadFile( |
| 149 | this.#conId, |
| 150 | this.#cacheFile, |
| 151 | this.#path, |
| 152 | () => { |
| 153 | resolve(Url.join(this.#origin, this.#path)); |
| 154 | }, |
| 155 | reject, |
| 156 | ); |
| 157 | }); |
| 158 | } |
| 159 | |
| 160 | async createFile(name, content = "") { |
| 161 | await this.#connectIfNotConnected(); |
no test coverage detected