Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix upload with small file names

Chocobozzzf2c3f7cd8a59
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 4c9dbf1bbd..ae5548897d 100644
--- a/client/src/app/videos/+video-edit/video-add.component.ts
+++ b/client/src/app/videos/+video-edit/video-add.component.ts
@@ -156,7 +156,16 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy
this.videoFileName = videofile.name
- const name = videofile.name.replace(/\.[^/.]+$/, '')
+ const nameWithoutExtension = videofile.name.replace(/\.[^/.]+$/, '')
+ let name: string
+
+ // If the name of the file is very small, keep the extension
+ if (nameWithoutExtension.length < 3) {
+ name = videofile.name
+ } else {
+ name = nameWithoutExtension
+ }
+
const privacy = this.firstStepPrivacyId.toString()
const nsfw = false
const commentsEnabled = true