Remove file size limit for loop file uploads

This commit is contained in:
Ingo Oppermann 2024-09-26 21:42:27 +02:00
parent 78dc5dd189
commit ba8f4237da
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E
4 changed files with 7 additions and 7 deletions

View File

@ -53,7 +53,7 @@ export default function UploadButton({
return;
}
if (file.size > type.maxSize) {
if (type.maxSize > 0 && file.size > type.maxSize) {
// the file is too big
onError({
type: 'size',

View File

@ -15,7 +15,7 @@ import Filesize from '../../../misc/Filesize';
import FormInlineButton from '../../../misc/FormInlineButton';
import UploadButton from '../../../misc/UploadButton';
const imageTypes = [{ mimetype: 'audio/*', extension: 'audio', maxSize: 25 * 1024 * 1024 }];
const imageTypes = [{ mimetype: 'audio/*', extension: 'audio', maxSize: 0 }];
const useStyles = makeStyles((theme) => ({
gridContainer: {

View File

@ -15,7 +15,7 @@ import Filesize from '../../../misc/Filesize';
import FormInlineButton from '../../../misc/FormInlineButton';
import UploadButton from '../../../misc/UploadButton';
const imageTypes = [{ mimetype: 'application/sdp', extension: '*.sdp', maxSize: 2 * 1024 * 1024 }];
const fileTypes = [{ mimetype: 'application/sdp', extension: '*.sdp', maxSize: 2 * 1024 * 1024 }];
const useStyles = makeStyles((theme) => ({
gridContainer: {
@ -146,7 +146,7 @@ function Source({
<Grid container alignItems="flex-start" spacing={2} className={classes.gridContainer}>
<Grid item xs={12}>
<Typography variant="caption">
<Trans>Upload SDP file ({imageTypes.map((t) => t.mimetype).join(', ')}).</Trans>
<Trans>Upload SDP file ({fileTypes.map((t) => t.mimetype).join(', ')}).</Trans>
</Typography>
</Grid>
<Grid item xs={12} md={9}>
@ -155,7 +155,7 @@ function Source({
<Grid item xs={12} md={3}>
<UploadButton
label={<Trans>Upload</Trans>}
acceptTypes={imageTypes}
acceptTypes={fileTypes}
onStart={handleUploadStart}
onError={handleUploadError(<Trans>Uploading the file failed</Trans>)}
onUpload={handleFileUpload}

View File

@ -16,8 +16,8 @@ import FormInlineButton from '../../../misc/FormInlineButton';
import UploadButton from '../../../misc/UploadButton';
const imageTypes = [
{ mimetype: 'image/*', extension: 'image', maxSize: 2 * 1024 * 1024 },
{ mimetype: 'video/*', extension: 'video', maxSize: 25 * 1024 * 1024 },
{ mimetype: 'image/*', extension: 'image', maxSize: 0 },
{ mimetype: 'video/*', extension: 'video', maxSize: 0 },
];
const useStyles = makeStyles((theme) => ({