summaryrefslogtreecommitdiff
path: root/std/mime/multipart.ts
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2020-10-20 19:51:57 +0800
committerGitHub <noreply@github.com>2020-10-20 13:51:57 +0200
commit17467d01dad3f280b7f788ba87953392a8e304bb (patch)
treec9b8714a0ec222bbb9525071368ac8a923e7f8aa /std/mime/multipart.ts
parent9cf06f76fdeb4b8cff4a47e269984d3b9a64a9be (diff)
fix(std/io): remove trivial internal util.ts module (#8032)
Diffstat (limited to 'std/mime/multipart.ts')
-rw-r--r--std/mime/multipart.ts9
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);