fix: max file size to 100mb for custom template
This commit is contained in:
parent
77d97b6954
commit
96ce602433
6 changed files with 18 additions and 6 deletions
|
|
@ -8,7 +8,7 @@ events {
|
|||
}
|
||||
|
||||
http {
|
||||
client_max_body_size 20M;
|
||||
client_max_body_size 100M;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ async def upload_files(files: Optional[List[UploadFile]]):
|
|||
|
||||
temp_dir = TEMP_FILE_SERVICE.create_temp_dir(get_random_uuid())
|
||||
|
||||
validate_files(files, True, True, 50, UPLOAD_ACCEPTED_FILE_TYPES)
|
||||
validate_files(files, True, True, 100, UPLOAD_ACCEPTED_FILE_TYPES)
|
||||
|
||||
temp_files: List[str] = []
|
||||
if files:
|
||||
|
|
|
|||
|
|
@ -46,6 +46,12 @@ async def process_pdf_slides(
|
|||
status_code=400,
|
||||
detail=f"Invalid file type. Expected PDF file, got {pdf_file.content_type}"
|
||||
)
|
||||
# Enforce 100MB size limit
|
||||
if hasattr(pdf_file, "size") and pdf_file.size and pdf_file.size > (100 * 1024 * 1024):
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
detail="PDF file exceeded max upload size of 100 MB",
|
||||
)
|
||||
|
||||
# Create temporary directory for processing
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
|
|
|
|||
|
|
@ -275,6 +275,12 @@ async def process_pptx_slides(
|
|||
status_code=400,
|
||||
detail=f"Invalid file type. Expected PPTX file, got {pptx_file.content_type}"
|
||||
)
|
||||
# Enforce 100MB size limit
|
||||
if hasattr(pptx_file, "size") and pptx_file.size and pptx_file.size > (100 * 1024 * 1024):
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
detail="PPTX file exceeded max upload size of 100 MB",
|
||||
)
|
||||
|
||||
# Create temporary directory for processing
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export const FileUploadSection: React.FC<FileUploadSectionProps> = ({
|
|||
Upload PDF or PPTX File
|
||||
</CardTitle>
|
||||
<CardDescription>
|
||||
Select a PDF or PowerPoint file (.pdf or .pptx) to process. Maximum file size: 50MB
|
||||
Select a PDF or PowerPoint file (.pdf or .pptx) to process. Maximum file size: 100MB
|
||||
</CardDescription>
|
||||
{slides.length > 0 && (
|
||||
<div className="flex items-center justify-end gap-2">
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ export const useFileUpload = () => {
|
|||
return;
|
||||
}
|
||||
|
||||
// Validate file size (50MB limit)
|
||||
const maxSize = 50 * 1024 * 1024; // 50MB
|
||||
// Validate file size (100MB limit)
|
||||
const maxSize = 100 * 1024 * 1024; // 100MB
|
||||
if (file.size > maxSize) {
|
||||
toast.error("File size must be less than 50MB");
|
||||
toast.error("File size must be less than 100MB");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue