rev: batasan maximal upload file

Deskripsi:
- project, task, dan dokumen divisi maximal 100mb
- user profile dan banner desa maximal 10mb

nb: di server blm bisa

NO Issues
This commit is contained in:
amel
2025-01-13 10:50:55 +08:00
parent 3125cd8b82
commit 98c815fa35
10 changed files with 22 additions and 22 deletions

View File

@@ -119,10 +119,10 @@ function CreateBanner() {
onValidation('image', files[0]) onValidation('image', files[0])
}} }}
activateOnClick={false} activateOnClick={false}
maxSize={1 * 1024 ** 2} maxSize={10 * 1024 ** 2}
accept={['image/png', 'image/jpeg', 'image/heic']} accept={['image/png', 'image/jpeg', 'image/heic']}
onReject={(files) => { onReject={(files) => {
return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 1 MB') return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 10 MB')
}} }}
onClick={() => openRef.current?.()} onClick={() => openRef.current?.()}
> >

View File

@@ -120,10 +120,10 @@ export default function EditBanner() {
onValidation('image', files[0]) onValidation('image', files[0])
}} }}
activateOnClick={false} activateOnClick={false}
maxSize={1 * 1024 ** 2} maxSize={10 * 1024 ** 2}
accept={['image/png', 'image/jpeg', 'image/heic']} accept={['image/png', 'image/jpeg', 'image/heic']}
onReject={(files) => { onReject={(files) => {
return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 1 MB') return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 10 MB')
}} }}
onClick={() => openRef.current?.()} onClick={() => openRef.current?.()}
> >

View File

@@ -148,13 +148,13 @@ export default function DrawerMenuDocumentDivision() {
onUploadFile(files[0]) onUploadFile(files[0])
}} }}
activateOnClick={false} activateOnClick={false}
maxSize={3 * 1024 ** 2} maxSize={100 * 1024 ** 2}
accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']} accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']}
onReject={(files) => { onReject={(files) => {
refresh.set(true) refresh.set(true)
setOpenModal(false) setOpenModal(false)
setOpenDrawerDocument(false) setOpenDrawerDocument(false)
toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 3 MB') toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 100 MB')
}} }}
> >
<Flex justify={'center'} align={'center'} direction={'column'} mb={20} onClick={() => openRef.current?.()}> <Flex justify={'center'} align={'center'} direction={'column'} mb={20} onClick={() => openRef.current?.()}>

View File

@@ -105,10 +105,10 @@ export default function AddFileDetailProject() {
cekFileName(files[0]) cekFileName(files[0])
}} }}
activateOnClick={false} activateOnClick={false}
maxSize={3 * 1024 ** 2} maxSize={100 * 1024 ** 2}
accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']} accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']}
onReject={(files) => { onReject={(files) => {
return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 3 MB') return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 100 MB')
}} }}
> >
</Dropzone> </Dropzone>

View File

@@ -412,10 +412,10 @@ export default function CreateProject() {
setListFile([...listFile, { name: files[0].name, extension: files[0].type.split("/")[1] }]) setListFile([...listFile, { name: files[0].name, extension: files[0].type.split("/")[1] }])
}} }}
activateOnClick={false} activateOnClick={false}
maxSize={3 * 1024 ** 2} maxSize={100 * 1024 ** 2}
accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']} accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']}
onReject={(files) => { onReject={(files) => {
return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 3 MB') return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 100 MB')
}} }}
></Dropzone> ></Dropzone>
@@ -437,10 +437,10 @@ export default function CreateProject() {
setListFile([...listFile, { name: files[0].name, extension: files[0].type.split("/")[1] }]) setListFile([...listFile, { name: files[0].name, extension: files[0].type.split("/")[1] }])
}} }}
activateOnClick={false} activateOnClick={false}
maxSize={3 * 1024 ** 2} maxSize={100 * 1024 ** 2}
accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf']} accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf']}
onReject={(files) => { onReject={(files) => {
return toast.error('File yang diizinkan: .png, .jpg, .heic, .pdf dengan ukuran maksimal 3 MB') return toast.error('File yang diizinkan: .png, .jpg, .heic, .pdf dengan ukuran maksimal 100 MB')
}} }}
> >
<Box onClick={() => openRef.current?.()}> <Box onClick={() => openRef.current?.()}>

View File

@@ -106,10 +106,10 @@ export default function AddFileDetailTask() {
cekFileName(files[0]) cekFileName(files[0])
}} }}
activateOnClick={false} activateOnClick={false}
maxSize={3 * 1024 ** 2} maxSize={100 * 1024 ** 2}
accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']} accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']}
onReject={(files) => { onReject={(files) => {
return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 3 MB') return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 100 MB')
}} }}
> >
</Dropzone> </Dropzone>

View File

@@ -335,10 +335,10 @@ export default function CreateTask() {
setListFile([...listFile, { name: files[0].name, extension: files[0].type.split("/")[1] }]) setListFile([...listFile, { name: files[0].name, extension: files[0].type.split("/")[1] }])
}} }}
activateOnClick={false} activateOnClick={false}
maxSize={3 * 1024 ** 2} maxSize={100 * 1024 ** 2}
accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']} accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']}
onReject={(files) => { onReject={(files) => {
return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 3 MB') return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 100 MB')
}} }}
></Dropzone> ></Dropzone>

View File

@@ -283,10 +283,10 @@ export default function CreateMember() {
setIMG(buffer) setIMG(buffer)
}} }}
activateOnClick={false} activateOnClick={false}
maxSize={1 * 1024 ** 2} maxSize={10 * 1024 ** 2}
accept={['image/png', 'image/jpeg', 'image/heic']} accept={['image/png', 'image/jpeg', 'image/heic']}
onReject={(files) => { onReject={(files) => {
return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 1 MB') return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 10 MB')
}} }}
> >
</Dropzone> </Dropzone>

View File

@@ -215,10 +215,10 @@ export default function EditMember({ id }: { id: string }) {
setIMG(buffer) setIMG(buffer)
}} }}
activateOnClick={false} activateOnClick={false}
maxSize={1 * 1024 ** 2} maxSize={10 * 1024 ** 2}
accept={['image/png', 'image/jpeg', 'image/heic']} accept={['image/png', 'image/jpeg', 'image/heic']}
onReject={(files) => { onReject={(files) => {
return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 1 MB') return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 10 MB')
}} }}
> >
</Dropzone> </Dropzone>

View File

@@ -178,11 +178,11 @@ export default function EditProfile() {
setIMG(buffer); setIMG(buffer);
}} }}
activateOnClick={false} activateOnClick={false}
maxSize={1 * 1024 ** 2} maxSize={10 * 1024 ** 2}
accept={["image/png", "image/jpeg", "image/heic"]} accept={["image/png", "image/jpeg", "image/heic"]}
onReject={(files) => { onReject={(files) => {
return toast.error( return toast.error(
"File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 1 MB" "File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 10 MB"
); );
}} }}
></Dropzone> ></Dropzone>