Add size to job listing and upload.
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user