File count vs database table rows

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
slinghang1
Registered User
Posts: 17
Joined: Thu Feb 08, 2024 4:02 am
Location: ON, Canada

File count vs database table rows

Post by slinghang1 »

If my database table phpbb_attachments has 59551 rows should there be the same number of files in the /files directory?

My /files directory has just under 7998 files in it according to Filezilla, and the db table 59551 rows.

Is it possible that Filezilla is limiting how many files it displays or am I missing a lot of files?
User avatar
AmigoJack
Registered User
Posts: 6115
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン

Re: File count vs database table rows

Post by AmigoJack »

slinghang1 wrote: Sun Feb 18, 2024 3:55 amIs it possible that Filezilla is limiting how many files it displays
Most likely the FTP server limits this. But never your FTP client. 7998 files (or entries in general) + 2 entries for the current (.) and the parent folder (..) = 8000 is a perfect straight number coming from a setting. You can't do anything about this, except asking your hoster to make an exception for you. Access your server shell wise and execute something like ls |wc to see how many entries reside in a folder. Or count it with your own PHP file.
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5999
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: File count vs database table rows

Post by thecoalman »

This is a limitation when using regular FTP, it's a configuration on ProFTP which is the FTP service running on the server. . Even selecting to download the files directory itself will fail to download all the files.

If you use SFTP it should list them all. If you have 59K rows and assuming most are images with thumbnails it should be almost 120K files.

Since you mentioned Filezilla make sure you have changed the options so it treats files without extensions as binary otherwise it will corrupt your image attachements.

https://www.phpbb.com/support/docs/en/3 ... filezilla/
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
AmigoJack
Registered User
Posts: 6115
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン

Re: File count vs database table rows

Post by AmigoJack »

thecoalman wrote: Mon Feb 19, 2024 10:31 pmProFTP which is the FTP service running on the server. .
How do you know it's that particular software?
thecoalman wrote: Mon Feb 19, 2024 10:31 pmEven selecting to download the files directory itself will fail to download all the files.
Because the FTP client does nothing else than listing "all" the content of that folder, which hits the same problem. The FTP server configuration would be pointless if the limit could be circumvented that easy, eh?
thecoalman wrote: Mon Feb 19, 2024 10:31 pmIf you use SFTP it should list them all
There's no guarantee an SFTP server is running and there's no guarantee it comes with its own limitations. It's equivalent of just trying another option ("have you tried pulling the plug?")... whereas writing and calling an own PHP script would easily solve it, because that should always be possible.
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5999
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: File count vs database table rows

Post by thecoalman »

AmigoJack wrote: Tue Feb 20, 2024 1:35 pmHow do you know it's that particular software?
Correct it could be other FTP software on the server but that is unlikely.

The FTP server configuration would be pointless if the limit could be circumvented that easy, eh?
I'm passing on some information for those that may not be aware of this. Most people expect if for example they select the public_html directory in FTP and copy it that they will get all the files which is not necessarily the case. It's something that can very easily be overlooked. It's very relevant information for phpBB since all attachments are stored in a single directory and you could easily exceed the limit.

There's no guarantee an SFTP server is running and there's no guarantee it comes with its own limitations.
I have yet to encounter any issues using SFTP even on cheap shared hosting plans.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison

Return to “[3.3.x] Support Forum”