mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-16 17:25:58 +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 { getErrorMessage } from "../../Tables/Utilities";
|
||||||
import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent";
|
import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent";
|
||||||
|
|
||||||
const UPLOAD_FILE_SIZE_LIMIT_KB = 2097152;
|
|
||||||
|
|
||||||
export interface UploadItemsPaneProps {
|
export interface UploadItemsPaneProps {
|
||||||
explorer: Explorer;
|
explorer: Explorer;
|
||||||
closePanel: () => void;
|
closePanel: () => void;
|
||||||
@ -47,10 +45,6 @@ export const UploadItemsPane: FunctionComponent<UploadItemsPaneProps> = ({
|
|||||||
setFormError("No files specified");
|
setFormError("No files specified");
|
||||||
setFormErrorDetail("No files were specified. Please input at least one file.");
|
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.");
|
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();
|
const selectedCollection = explorer.findSelectedCollection();
|
||||||
@ -79,14 +73,6 @@ export const UploadItemsPane: FunctionComponent<UploadItemsPaneProps> = ({
|
|||||||
setFiles(event.target.files);
|
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 = {
|
const genericPaneProps: GenericRightPaneProps = {
|
||||||
container: explorer,
|
container: explorer,
|
||||||
formError,
|
formError,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user