About the need of a name like 1-6af529412baa4341834a0ceb4a72a1d7.jpg

Robert9

Well-known member
Is there any reason, why a saved filename should have such name?
Anyway, it is unique, because of the data_id?
Why we save billions of images worldwide like this, instead with {data_id}.jpg, please?
 
The file name like 1-6af529412baa4341834a0ceb4a72a1d7.jpg is generated automatically to ensure the uniqueness of the file. This means that there will not be two files with the same name, which avoids potential file conflicts. All the data, and more than just the date, is stored within the image. Experienced people can easily extract it.
 
Sorry, but that can not be the answer.

If the filename is:

{attachment_id}-{hash}.{suffix}

and this is not more or less unique than

{attachment_id}-we_all_live_on_the_same_planet_with_the_same_sun_and_sunglasses.jpg
{attachment_id}-we_all_live_on_the_same_planet_with_the_same_sun_and_sunglasses.jpg
{attachment_id}-we_all_live_on_the_same_planet_with_the_same_sun_and_sunglasses.jpg
{attachment_id}-we_all_live_on_the_same_planet_with_the_same_sun_and_sunglasses.jpg
{attachment_id}-we_all_live_on_the_same_planet_with_the_same_sun_and_sunglasses.jpg
{attachment_id}-we_all_live_on_the_same_planet_with_the_same_sun_and_sunglasses.jpg

when there is never a same {attachment_id}. And the {attachment_id} is an auto-keyed-integer, we never have twice times.

There must be another reason.
 
Also don't forget, that files in the data directory are publicly accessible. That's why we need an image filename that can not be easily guessed.
 
Back
Top Bottom