diff --git a/src/handlers.ts b/src/handlers.ts index f2a0bc6..9088692 100644 --- a/src/handlers.ts +++ b/src/handlers.ts @@ -16,6 +16,7 @@ export async function handleIpfsFileUpload( try { const content = await ipfsProvider.uploadFile(file.tempFilePath); + await fs.unlink(file.tempFilePath, () => null); return res.status(200).json(content); } catch (e) { console.log(e); @@ -37,6 +38,7 @@ export async function handleIpfsImageWithThumbnailUpload( try { const content = await ipfsProvider.uploadImageWithThumbnail(file.tempFilePath); + await fs.unlink(file.tempFilePath, () => null); return res.status(200).json(content); } catch (e) { console.log(e); diff --git a/src/index.ts b/src/index.ts index 28fbc41..fc5e98e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -21,7 +21,7 @@ async function createHttpServer(app: Express) { app.use(bodyParser.json()); app.use( fileUpload({ - limits: { fileSize: 30 * 1024 * 1024 }, // 30MB + limits: { fileSize: 100 * 1024 * 1024 }, // 100MB useTempFiles: true }) );