mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 15:06:55 +00:00
Remove File upload size check (#605)
This commit is contained in:
parent
d8fe4ed77f
commit
ba24eabe7c
@ -8,8 +8,6 @@ import Explorer from "../../Explorer";
|
||||
import { getErrorMessage } from "../../Tables/Utilities";
|
||||
import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent";
|
||||
|
||||
const UPLOAD_FILE_SIZE_LIMIT_KB = 2097152;
|
||||
|
||||
export interface UploadItemsPaneProps {
|
||||
explorer: Explorer;
|
||||
closePanel: () => void;
|
||||
@ -47,10 +45,6 @@ export const UploadItemsPane: FunctionComponent<UploadItemsPaneProps> = ({
|
||||
setFormError("No files specified");
|
||||
setFormErrorDetail("No files were specified. Please input at least one file.");
|
||||
logConsoleError("Could not upload items -- No files were specified. Please input at least one file.");
|
||||
} else if (_totalFileSizeForFileList(files) > UPLOAD_FILE_SIZE_LIMIT_KB) {
|
||||
setFormError("Upload file size limit exceeded");
|
||||
setFormErrorDetail("Total file upload size exceeds the 2 MB file size limit.");
|
||||
logConsoleError("Could not upload items -- Total file upload size exceeds the 2 MB file size limit.");
|
||||
}
|
||||
|
||||
const selectedCollection = explorer.findSelectedCollection();
|
||||
@ -79,14 +73,6 @@ export const UploadItemsPane: FunctionComponent<UploadItemsPaneProps> = ({
|
||||
setFiles(event.target.files);
|
||||
};
|
||||
|
||||
const _totalFileSizeForFileList = (fileList: FileList): number => {
|
||||
let totalFileSize = 0;
|
||||
for (let i = 0; i < fileList?.length; i++) {
|
||||
totalFileSize += fileList.item(i).size;
|
||||
}
|
||||
return totalFileSize;
|
||||
};
|
||||
|
||||
const genericPaneProps: GenericRightPaneProps = {
|
||||
container: explorer,
|
||||
formError,
|
||||
|
Loading…
Reference in New Issue
Block a user