chore: Separate maximum import size config for document/workspace (#6566)

* chore: Separate maximum import size config for document/workspace

* Update .env.sample
This commit is contained in:
Tom Moor
2024-02-20 20:35:31 -08:00
committed by GitHub
parent 15046d00a5
commit 7c03963be1
11 changed files with 50 additions and 19 deletions

View File

@@ -38,7 +38,7 @@ function DropToImport({ disabled, onSubmit, children, format }: Props) {
try {
const attachment = await uploadFile(file, {
name: file.name,
preset: AttachmentPreset.Import,
preset: AttachmentPreset.WorkspaceImport,
});
await collections.import(attachment.id, format);
onSubmit();

View File

@@ -596,10 +596,10 @@ export default class DocumentsStore extends Store<Document> {
throw new Error(`The selected file type is not supported (${file.type})`);
}
if (file.size > env.MAXIMUM_IMPORT_SIZE) {
if (file.size > env.FILE_STORAGE_IMPORT_MAX_SIZE) {
throw new Error(
`The selected file was larger than the ${bytesToHumanReadable(
env.MAXIMUM_IMPORT_SIZE
env.FILE_STORAGE_IMPORT_MAX_SIZE
)} maximum size`
);
}