From 81c263c86fe2a030f09e942e118551727f145b6d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 22 Feb 2018 16:54:08 +0100 Subject: [PATCH] Add limit to video sizes --- client/src/app/videos/+video-edit/video-add.component.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts index e81243d3e..324f26983 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts @@ -133,9 +133,15 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy } uploadFirstStep () { - const videofile = this.videofileInput.nativeElement.files[0] + const videofile = this.videofileInput.nativeElement.files[0] as File if (!videofile) return + // Cannot upload videos > 4GB for now + if (videofile.size > 4 * 1024 * 1024 * 1024) { + this.notificationsService.error('Error', 'We are sorry but PeerTube cannot handle videos > 4GB') + return + } + const videoQuota = this.authService.getUser().videoQuota if (videoQuota !== -1 && (this.userVideoQuotaUsed + videofile.size) > videoQuota) { const bytePipes = new BytesPipe() -- 2.25.1