Supporting .htaccess configuration
| Project: | Filebrowser |
| Version: | HEAD |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | macko |
| Status: | needs review |
Hi,
Looking at the other feature requests (displaying created/modified date, default sorting, icons), plus a few issues that I consider very important (being able to add header and footer message) -- these all need some kind of a config file.
Why not adopt a subset of apache's well-known, popular and documented .htaccess -- it has that all. I know that Filebrowser is primarily an FTP directory substitute, but I believe the features mentioned above are important, and it would be really nice if Filebrowser were not more limited than a http listing.
Filebrowser could look for .htaccess, or htaccess, and when found, read and support some part of it (for start, it could just handle AddDescription). AddDescription in .htaccess is actually more flexible as it allows for wildcards, but we could ignore this feature.
As an off-topic thing, I noticed that "human-readable" file sizes that are displayed in *nix programs (like ls -h) are much better (smarter algorithm to round numbers) than "human-readable" file sizes displayed in Filebrowser.
Cheers,
macko

#1
You can add a header message by the descript.ion file.
I've used htaccess since many years and I like it. I would prefer htaccess syntax instead of descript.ion syntax (
"Description text" file.ext).#2
I think this is definitely something to look into, especially since .htaccess files might already exist for the relevant directories. Regarding the human-readable file sizes, however, you should bring that up with Drupal core, as I use a built-in Drupal function to convert bytes to human-readable strings.
Although this may be useful, I don't want to remove descript.ion functionality as that's been with this module for a long time. Also, the theming functionality exposed by this module should allow you to alter the display of the file listing page almost as much as you would like. Unless .htaccess exposes additional functionality outside of descript.ion and theme overriding, I can't see implementing support for it. AddDescription isn't enough to warrant the code and time spent.
#3
Hmm, I think I am missing something... as far as I see it, supporting .htaccess is entirely independent from themes, just as descript.ion is.
.htaccess is only able to store more settings than descript.ion, including a few key items like what columns to display, what column order, what is the default sort, what are header and footer message files.
How is this related to theming?
#4
OK, we have got this implemented (limited support for .htaccess, while the descript.ion file, if present, is considered more important - to ensure compatibility with older versions of Filebrowser).
How do we proceed? Commit to drupal svn or email new version to the maintainer?
#5
To get this reviewed, attach a patch. This is documentation describing the standard method to contributing here: http://drupal.org/patch
#6
Here it is.
Supported features:
and, .htaccess files are not inherited from parent directories (as they are for apache).
Column names are case-insensitive, lines starting with # are ignored.
#7
A few more improvements in this patch: date and size are no longer broken into lines, short time format is used.
A working sample available at
http://www.framsticks.com/dev/files
The original .htaccess file from apache (that is used on that site) starts with:
IndexIgnore .. .htaccess readme.html foot.htmlIndexOptions FancyIndexing DescriptionWidth=* NameWidth=* SuppressHTMLPreamble
IndexOrderDefault Descending Date
HeaderName readme.html
#ReadmeName foot.html
AddDescription ...
#8
is there a patch available for the newest version? I would like to show modified date.
Thanks!
#9
Not yep, I'll try to integrate this as soon as I can