Send back only new files on upload.
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
import path from "path";
|
||||
|
||||
export default function (file: Express.Multer.File) {
|
||||
return `${file.originalname}-${Math.floor(Date.now() / 1000)}${path.extname(
|
||||
return `${path.parse(path.basename(file.originalname)).name}-${Math.floor(
|
||||
Date.now() / 1000
|
||||
)}${path.extname(file.originalname)}`;
|
||||
}
|
||||
|
||||
export function generateUniqueBillFilename(
|
||||
file: Express.Multer.File,
|
||||
invoice_number: string
|
||||
) {
|
||||
return `${invoice_number}-${Math.floor(Date.now() / 1000)}${path.extname(
|
||||
file.originalname
|
||||
)}`;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import internal from "stream";
|
||||
|
||||
interface MediaFile {
|
||||
src: string;
|
||||
thumb: string;
|
||||
thumbnail: string;
|
||||
thumbnailHeight: number;
|
||||
thumbnailWidth: number;
|
||||
}
|
||||
|
||||
export default MediaFile;
|
||||
|
||||
Reference in New Issue
Block a user