X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fforms%2Freactive-file.component.ts;h=f60c38e8de8052a4b23d20547fc634906975b161;hb=8dfceec44a5eec8b0190d1d5076aab0f03a0cb52;hp=c3986838f549c1c18302d984c638546c043bf310;hpb=f8b2c1b4f509c037b9650cca2c5befd21f056df3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/forms/reactive-file.component.ts b/client/src/app/shared/forms/reactive-file.component.ts index c3986838f..f60c38e8d 100644 --- a/client/src/app/shared/forms/reactive-file.component.ts +++ b/client/src/app/shared/forms/reactive-file.component.ts @@ -53,6 +53,17 @@ export class ReactiveFileComponent implements OnInit, ControlValueAccessor { return } + const extension = '.' + file.name.split('.').pop() + if (this.extensions.includes(extension) === false) { + const message = this.i18n( + 'PeerTube cannot handle this kind of file. Accepted extensions are {{extensions}}.', + { extensions: this.allowedExtensionsMessage } + ) + this.notifier.error(message) + + return + } + this.file = file this.propagateChange(this.file)