diff --git a/src/services/drive/upload-from-url.ts b/src/services/drive/upload-from-url.ts index 676586cd1..b3bb47033 100644 --- a/src/services/drive/upload-from-url.ts +++ b/src/services/drive/upload-from-url.ts @@ -19,7 +19,7 @@ export default async (url, user, folderId = null, uri = null): Promise void, rej) => { + const path = await new Promise((res, rej) => { tmp.file((e, path) => { if (e) return rej(e); res(path); @@ -44,8 +44,8 @@ export default async (url, user, folderId = null, uri = null): Promise { - if (e) log(e.stack); + fs.unlink(path, e => { + if (e) console.error(e); }); return driveFile;