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:
@@ -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();
|
||||
|
||||
@@ -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`
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user