diff options
Diffstat (limited to 'std/mime/multipart.ts')
-rw-r--r-- | std/mime/multipart.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/std/mime/multipart.ts b/std/mime/multipart.ts index 6597a1bea..73af72357 100644 --- a/std/mime/multipart.ts +++ b/std/mime/multipart.ts @@ -3,7 +3,6 @@ import { equal, findIndex, findLastIndex, hasPrefix } from "../bytes/mod.ts"; import { copyN } from "../io/ioutil.ts"; import { MultiReader } from "../io/readers.ts"; import { extname } from "../path/mod.ts"; -import { tempFile } from "../io/util.ts"; import { BufReader, BufWriter } from "../io/bufio.ts"; import { encoder } from "../encoding/utf8.ts"; import { assert } from "../_util/assert.ts"; @@ -310,10 +309,14 @@ export class MultipartReader { if (n > maxMemory) { // too big, write to disk and flush buffer const ext = extname(p.fileName); - const { file, filepath } = await tempFile(".", { + const filepath = await Deno.makeTempFile({ + dir: ".", prefix: "multipart-", - postfix: ext, + suffix: ext, }); + + const file = await Deno.open(filepath, { write: true }); + try { const size = await Deno.copy(new MultiReader(buf, p), file); |