mirror of
https://github.com/Dadechin/Dashboard-XRoom.git
synced 2025-07-03 00:34:34 +00:00
upload limit
This commit is contained in:
parent
b190fe0675
commit
4c2b402b7a
|
@ -21,7 +21,7 @@ class PdfSerializer(serializers.ModelSerializer):
|
||||||
# Check file size if image is provided
|
# Check file size if image is provided
|
||||||
if 'pdf' in request.FILES:
|
if 'pdf' in request.FILES:
|
||||||
pdf = request.FILES['pdf']
|
pdf = request.FILES['pdf']
|
||||||
if pdf.size > 50 * 1024 * 1024: # 50MB limit
|
if pdf.size > 10 * 1024 * 1024: # 50MB limit
|
||||||
raise serializers.ValidationError("Pdf file too large ( > 50MB )")
|
raise serializers.ValidationError("Pdf file too large ( > 50MB )")
|
||||||
|
|
||||||
# Check file extension
|
# Check file extension
|
||||||
|
|
|
@ -21,7 +21,7 @@ class VideoSerializer(serializers.ModelSerializer):
|
||||||
# Check file size if image is provided
|
# Check file size if image is provided
|
||||||
if 'video' in request.FILES:
|
if 'video' in request.FILES:
|
||||||
video = request.FILES['video']
|
video = request.FILES['video']
|
||||||
if video.size > 500 * 1024 * 1024: # 500MB limit
|
if video.size > 200 * 1024 * 1024: # 500MB limit
|
||||||
raise serializers.ValidationError("Video file too large ( > 500MB )")
|
raise serializers.ValidationError("Video file too large ( > 500MB )")
|
||||||
|
|
||||||
# Check file extension
|
# Check file extension
|
||||||
|
|
Loading…
Reference in New Issue
Block a user