Oleg wrote:The problem with this is on boards that have thousands of attachments the attachment id may very well have been expanded to a full 32-bit field.
So, those boards are modded, and the subfolder-attachment function has also the need be modded like in other cases board owners decide to change default database setup (i'm not sure if dbal can figure out the type of fields, so it can be done automatically)
mediumint, by the way has a maximum of 16,777,215 (16M)
Oleg wrote:This I'm having a hard time understanding and I also don't understand why you need two levels of directories for 64k attachments. 256*256=64k, if you have 256 directories on the top level each will have no more than 256 files in it.
it can be up to 514 file in each subfolder (256 attachments, 256 thumbs for attachments, .htaccess and (empty) index.htm to prevent folder browsing like in every other folder on pbpBB), but this is a guaranteed maximum. And also the number of subfolders in a folder will never go over 256, so we don't break the directory list maximum of many ftp server settings.
Yes, for the first 64k attachments, all files will go into folder "00", with subfolders up to "ff".
Oleg wrote:To create a backup you would list, not download, every directory on the ftp server and only download the files you don't have.
Right, but it's much easier to list only the latest folders and not all subfolders. Eg.:
Last backup has shown a folder 00/0e, actual the board shows 00/10 as highest subfolder.
So, i have only to list folder 00/0e (because on last backup, it was not "full"), 00/0f (i don't have to list, because it is new since last backup and i can download it complete) and 00/10 (the same like 00/0f).
The next time, i can start at folder 00/10.
Following your logic for building folder names, every time i want to make a backup via ftp i have to check all 256 folders for new files.
It don''t know how many attachments exist on phpbb.com. Our board has 33,793 attachments at the moment (nearly all with thumbnails, so a total of > 67,000 files), which means our current subfolder in above syntax would be 00/84, the board is online since 2 1/2 years, i expect the 64k-border broken in the middle of 2013, so subfolder would change to 01/00.
My preferred subfolder syntax is by date (Y/m/w), so a board will have a three level subfolder syntax, but only 84 (12 month * 7 weekdays) folders a year. Smaller board can use "Y/m", having 12 subfolders per year.