Attachment subfolders

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The next feature release of phpBB 3 will be 3.2/Rhea followed by 3.3.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.1. If you need support for phpBB 3.1 please visit the 3.1.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Post Reply
Knot
Registered User
Posts: 5
Joined: Wed May 13, 2009 2:40 pm

Attachment subfolders

Post by Knot » Sun Jul 25, 2010 9:09 pm

Sorry if this topic don't follow the rules, and sorry for my english!

FTP clients have a limit for 1998 files per folder. If you have more then 1998 files in /file folder you can't see all the files. This is bad to make backups using FTP Clients.
Lots of files in the same folder isn't good for the server too.
My request is to use this in the next phpBB (The autor speaks english):
http://www.phpbbchina.com/forum/viewtop ... =23&t=3337

It has 3 funtions, but I'm asking only for the option to atach the files in subfolders. You can use the YEAR_MONTH model for the name of new folders, or other model.
I use it in my forum because I have more then 6000 attachments, and I think this is very useful.

Ticket created: http://tracker.phpbb.com/browse/PHPBB3-10119
Last edited by Oleg on Mon Apr 04, 2011 3:39 am, edited 1 time in total.
Reason: Added ticket link

User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 135
Joined: Sun Dec 18, 2005 5:44 pm
Location: Texas
Contact:

Re: Attachment subfolders

Post by Noxwizard » Mon Jul 26, 2010 1:12 am

Just to clarify, the limit is not in the FTP client, it's in the FTP daemon's settings. cPanel defaults to 2000 (1998 files/directories plus . and ..).

Knot
Registered User
Posts: 5
Joined: Wed May 13, 2009 2:40 pm

Re: Attachment subfolders

Post by Knot » Mon Jul 26, 2010 10:27 am

Noxwizard wrote:Just to clarify, the limit is not in the FTP client, it's in the FTP daemon's settings. cPanel defaults to 2000 (1998 files/directories plus . and ..).
Ok, but if you don't have acess to Cpanel you can't change this. And the all attachments in same folder is a large number of files to a single folder. Now I have a dedicated server so I don't have problems, but when I had my forum in shared servers, the administrators servers allways sent messages to me to didn't put many files in the same folder.

User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 557
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany
Contact:

Re: Attachment subfolders

Post by bantu » Mon Jul 26, 2010 12:31 pm

phpBB 3.0.x is not able to reliably create directories because of issues with safe_mode, if I remember correctly. Thus, the approach of generating subfolders in files generally doesn't work. This might no longer be the case with PHP 5.2, but I don't know.

As a workaround we could strip off the first character of the physical filename and ship 16 subfolders in files in our packages, but that would only move the problem to another limit (~16 * 2000 instead of ~2000).

I kind of doubt that this limit also affects SFTP (SSH File Transfer Protocol) which should be prefered for various reasons (one being encryption). Remember that FTP is like 100 years old.

Edit: There are however also filesystem limits on the number of files that can be stored in one folder (FAT32 has a limit of 65535 according to my quick research). We should probably look into that too.

User avatar
canonknipser
Registered User
Posts: 59
Joined: Mon Sep 19, 2011 4:42 am
Location: Germany

Re: Attachment subfolders

Post by canonknipser » Sat Dec 03, 2011 12:12 pm

I know this topic is a few days old ;)
I would really like to see this feature added in a future release, because currently we have more than 70,000 files in the file-folder (we force our members to use the attachment-function instead of using external hosted images), the board is up now for 2 1/2 years.
bantu wrote:phpBB 3.0.x is not able to reliably create directories because of issues with safe_mode, if I remember correctly. Thus, the approach of generating subfolders in files generally doesn't work. This might no longer be the case with PHP 5.2, but I don't know.
save_mode is removed in PHP 5.4; and with save_mode enabled a lot of other basic function may not work properly: http://de.php.net/manual/en/features.sa ... ctions.php

As a fallback, if creating a subdir via mkdir()-function fails, we can still use the basic path or use the pre-implemented structure oleg mentioned.

The creation of subdirs should be configurable; on our board, i decided to use a folder structure following the date rule 'Ym/w' (first level subfolders for year and month, second level subfolder numeric expression of weekday), but it should be a decision of board administrator.
Greetings, Frank

english is not my native language

User avatar
naderman
Product Manager
Product Manager
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

Re: Attachment subfolders

Post by naderman » Tue Dec 13, 2011 3:39 pm

Moved this to discussion. If people still want to see this I would suggest someone creates a detailed RFC explaining exactly what configuration would be necessary and where it should be located in the ACP. What the default behaviour should be and how the transition from one attachment subdirectory scheme to another should work. It should probably also feature some research into the ability to create directories with all php configurations and on all supported platforms.

User avatar
canonknipser
Registered User
Posts: 59
Joined: Mon Sep 19, 2011 4:42 am
Location: Germany

Re: Attachment subfolders

Post by canonknipser » Mon Dec 19, 2011 2:00 pm

Greetings, Frank

english is not my native language

Post Reply