renamed 5GB to better name of max file size supported

This commit is contained in:
Abhinav 2022-02-05 14:10:18 +05:30
parent c9129ce11c
commit 42670853e7
3 changed files with 5 additions and 5 deletions

View file

@ -39,4 +39,4 @@ export enum FileUploadResults {
UPLOADED,
}
export const FIVE_GB_IN_BYTES = 5 * 1024 * 1024 * 1024;
export const MAX_FILE_SIZE_SUPPORTED = 5 * 1024 * 1024 * 1024; // 5 GB

View file

@ -27,7 +27,7 @@ import {
import {
UPLOAD_STAGES,
FileUploadResults,
FIVE_GB_IN_BYTES,
MAX_FILE_SIZE_SUPPORTED,
} from 'constants/upload';
import { ComlinkWorker } from 'utils/comlink';
import { getFileType } from './readFileService';
@ -142,7 +142,7 @@ class UploadManager {
const reader = new FileReader();
for (const { file, collectionID } of mediaFiles) {
const { fileTypeInfo, metadata } = await (async () => {
if (file.size >= FIVE_GB_IN_BYTES) {
if (file.size >= MAX_FILE_SIZE_SUPPORTED) {
return { fileTypeInfo: null, metadata: null };
}
const fileTypeInfo = await getFileType(reader, file);

View file

@ -9,7 +9,7 @@ import UploadService from './uploadService';
import uploadService from './uploadService';
import { BackupedFile, FileWithCollection, UploadFile } from 'types/upload';
import { FILE_TYPE } from 'constants/file';
import { FileUploadResults, FIVE_GB_IN_BYTES } from 'constants/upload';
import { FileUploadResults, MAX_FILE_SIZE_SUPPORTED } from 'constants/upload';
import { getMetadataMapKey } from './metadataService';
interface UploadResponse {
@ -30,7 +30,7 @@ export default async function uploader(
getMetadataMapKey(collection.id, rawFile.name)
);
try {
if (rawFile.size >= FIVE_GB_IN_BYTES) {
if (rawFile.size >= MAX_FILE_SIZE_SUPPORTED) {
return { fileUploadResult: FileUploadResults.TOO_LARGE };
}
if (fileTypeInfo.fileType === FILE_TYPE.OTHERS) {