From: Chocobozzz Date: Thu, 22 Feb 2018 15:54:08 +0000 (+0100) Subject: Add limit to video sizes X-Git-Tag: v0.0.27-alpha~10 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=81c263c86fe2a030f09e942e118551727f145b6d;p=github%2FChocobozzz%2FPeerTube.git Add limit to video sizes --- 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()