immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
42.61k stars 2.08k forks source link

[BUG] Can't uplodad a file named ".jpg" or ".mp4" #5421

Closed simulot closed 1 month ago

simulot commented 8 months ago

The bug

Dropping a file named ".jpg" or ".mp4" on the app's page gives an error 400 Bad request.

The OS that Immich Server is running on

Debian

Version of Immich Server

1.89.0

Version of Immich Mobile App

N/A

Platform with the issue

Your docker-compose.yml content

Not relevant

Your .env content

Not relevant

Reproduction steps

Rename perfectly valide jpg file as ".JPG" and drop it on the app page.

Same behavior when uploading this using immich-go.

Additional information

Problem revealed by Tomato 🍅 on this discord server thread

simulot commented 8 months ago

Done a second ago image

Here a 403 because of the restriction

On my test server: image

jrasm91 commented 1 month ago

I looked into this. It's not that hard to change the app to support uploading it. However, it does lead to a lot of weird circumstances. Like a lot of the code relies on the fact that a file has a base name and an extension. The storage template in particular. Allowing the file to be named just .jpg or .mp4 introduces a lot of edge cases that I don't think are worth supporting. So going to close this as not planned.

simulot commented 1 month ago

We can find those weird cases in google takeout files. It's managed by immich-go by pretending the file name is noname.jpg