Add size to job listing and upload.

This commit is contained in:
Patrick Fic
2022-08-19 09:21:00 -07:00
parent 92e7e3ebda
commit 06c3eccdac

View File

@@ -36,6 +36,7 @@ export async function JobsListMedia(req: Request, res: Response) {
return { return {
type, type,
size: file.size,
src: GenerateUrl([ src: GenerateUrl([
FolderPaths.StaticPath, FolderPaths.StaticPath,
FolderPaths.JobsFolder, FolderPaths.JobsFolder,
@@ -75,9 +76,10 @@ export async function JobsListMedia(req: Request, res: Response) {
const type: core.FileTypeResult | undefined = await ft.fromFile( const type: core.FileTypeResult | undefined = await ft.fromFile(
relativeFilePath relativeFilePath
); );
const fileSize = await fs.stat(relativeFilePath);
return { return {
type, type,
size: fileSize.size,
src: GenerateUrl([ src: GenerateUrl([
FolderPaths.StaticPath, FolderPaths.StaticPath,
FolderPaths.JobsFolder, FolderPaths.JobsFolder,