V8-archive: Thumbnailer doesn't work for files with a special characters in the name

Created on 12 Jun 2019  路  10Comments  路  Source: directus/v8-archive

My filename was Q82_Q83_1_+_1_=_2_Foto_Kruis_en_Mol.jpg I'm suspecting that either the + or the = in the file name is causing issues. All other files seem to work fine

Note: i haven't reproduced this in an isolated instance.

bug duplicate

Most helpful comment

I recommend the UUID approach, because if a user uploads a library of images [image1,image2,image3] then anyone who loads image1 will see _/images/originals/image1.jpg and could then increase the number to get the next image.

Unless we never return the original file and instead stream it through an authenticated file.
Image.php?file=image1, would then check if the user has access to image1 instead of just displaying the original image, and if you increase the filename to image2, you don't have access, therefore, couldn't see it.

All 10 comments

This shouldn't be an issue soon:

  1. We'll move to UUID filenames
  2. "Original" filenames should be sanitized

@benhaynes

  1. "Original" filenames should be sanitized

We can use any approach but we are recommending to use this!

Cause if we use UUID names then the name of the file will become different random string from which the user uploaded!

Let me know your thoughts!

I recommend the UUID approach, because if a user uploads a library of images [image1,image2,image3] then anyone who loads image1 will see _/images/originals/image1.jpg and could then increase the number to get the next image.

Unless we never return the original file and instead stream it through an authenticated file.
Image.php?file=image1, would then check if the user has access to image1 instead of just displaying the original image, and if you increase the filename to image2, you don't have access, therefore, couldn't see it.

I think UUID is a more _secure_ option for file naming (for a default setting)... but we should keep the option to use the Original file name too.

In case the user try to upload the same file many times, the system will check an existent file with the same hash and not duplicate the file or it will upload the same file again?

We had a hash of the file to do this, but have disabled it since hashing the file contents was not performant enough. We can revisit this later though.

I was hoping that this would give us a clear default for naming... but as of now it's exactly 50/50!

https://twitter.com/directus/status/1139618994879696897

UUID seems like a "safer" default, but we need to still support "Original" as a Global Setting. BUT, let's wait the last 4 days of the poll and see what we get!

but have disabled it since hashing the file contents was not performant enough.

For files 20mb+ *

It will be fixed with the development of #337

Fixed in #1059

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rijkvanzanten picture rijkvanzanten  路  3Comments

Varulv1997 picture Varulv1997  路  3Comments

maettyhawk picture maettyhawk  路  3Comments

HashemKhalifa picture HashemKhalifa  路  3Comments

benhaynes picture benhaynes  路  4Comments