Question to preview folder structure

Hi,

I have a question regarding the preview generation of Nextcloud.

All previews are saved under appdata_xxxxx/preview, here is an example of a specific preview file:

appdata_xxxxxxx\preview\f\6\3\e\5\0\0\10050476\256-256-crop.jpg

The last direcotry 10050476 is clear to me, it is the file id from the database.

But what are all the other directories before?
It looks like the combination f63e500 is a hexadecimal number. I can not find anything related to this in the database.

Can someone please explain me, where this number comes from?

I’m using Nextcloud version: 24.0.1

Thanks a lot for you help :slight_smile:

Hi Demian,

I found this comment in lib/private/Preview/BackgroundCleanupJob.php that may answer your question:

[…] the way the new previews are stored. We take the md5 of the name (fileid) and split the first 7 chars. That way there are not a gazillion files in the root of the preview appdata.

The actual split seems to be implemented at the bottom of lib/private/Preview/Storage/Root.php.