Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Created a file named descript.ion. Added a line with filename and description (seperated with a space with cr-lf atthe end) but nothing is showing up on the page display. Can you explain how it works and also what happen with subdirs?
Comment | File | Size | Author |
---|---|---|---|
#14 | filebrowser.module.txt | 18.96 KB | clauded |
#12 | capture.jpeg | 23.06 KB | clauded |
Comments
Comment #1
clauded CreditAttribution: clauded commentedOk, after reading and understanding the code, I found that ":" is used to seperate filename from description so a description file might look like this :
filename1.ext: Description of filename1
filename2.ext: Description of filename2
dir1: Description of directory1
I also found a couple of bugs in the code so here's a revised version of filebowser.module with those bugs corrected and where the description is part of the table display so we have "filename-file size-file description", a more natural way of displaying content. May I suggest to make this part of the module :
3 other suggestions :
1. descript.ion syntax should be documented
2. the location of the file icons (and the syntax for file names) should be documented (create a subdir named icons in the module directory)
3. a set of standard icons could be included with the module (look at http://drupal.org/files/issues/mimetypes-01.zip.txt)
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedGood work, thanks Claude! It's a significant improvement of the module since a long time.
Now we still have the problem with the MIME type recognition (#268181: Cron vs. Subdirectory displaying) and your suggestion (#289127: Few suggestions - 'hey'). And there is a problem with the encoding of the file description.
It would be very good to have the metadata for the current directory at the top of the page. ;-)
Comment #3
clauded CreditAttribution: clauded commentedNot sure I can help with the mime bug.
The hey field display is corrected in the code submitted so I don't think it's an issue anymore.
Can you be more specific about the encoding issue?
Now for the metadata at the top of the page, I never been able to have it working here (maybe another bug). Perhaps we could turn this into an option : display metainfo at the top or inline so everybody would be happy.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedWith this bug the module isn't usable, imho.
Okay, but I've found another 'hey' in the code. :-)
I use German umlauts ä, ö, and ü in the file description. I have to use
&#xxx;
to display the umlauts. The rest of the site is encoded properly (UTF-8).The metadata as an additional input field in the node (in a seperate database field)? That's one solution and good for users without FTP access (who cannot upload the descript.ion file).
Comment #5
clauded CreditAttribution: clauded commentedFor the mime bug, if it can't be solved then the module could still be usefull for public downloads (with a mention in the documentation). At least for the first release of the final version...
The "hey" in filebrowser_node_info()? If so it can be replaced with
'title_label' => t('Title'),
.On my machine (OpenSuse), I can put foreign caracters in the desciption file and they are displayed ok (even German umlauts). Do you edit the file on linux or Windows?
For the metadata, I meant another option in the configuration :
And a couple of if statements to produce the right display :
Now your idea of using a db field to store the description is good but I prefer to have description with files. Anyway, if some one stores a new file, it has an ftp access on some kind so he can also update the descript.ion file. On the other hand, this could maybe solve the encoding problem...
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedSorry, my fault! I forgot to convert the file to UTF-8. :-/
Me too. It's like htaccess. In my pre-Drupal time I have had a download directory with the file descriptions in the htaccess file.
MIME bug:
Because I use only the private download the MIME bug is a big problem for me. It's unprofessional if users have to rename the file during or after the download.
Comment #7
clauded CreditAttribution: clauded commentedThomas,
If I understand well, the MIME bug occurs when cron is run and probably when it scan a directory listing page with private files. Not knowing the MIME type of the files, it just hangs there, correct? If this is the case, is it because the file was pushed with something like a ftp program instead of using the upload mechanism in Drupal and Drupal doesn't know about the file?
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedNo, the cron issue is fixed. I should change the subject of the issue to "Private download vs. MIME type recognition".
With private download the MIME bug is always existing.
This can be the reason for it that private download do not work with the filebrowser module. It is a bad solution to attach all files to the dir_listing node.
Comment #9
clauded CreditAttribution: clauded commentedMay I suggest to start a new thread on this one and explain what is not working (are files displayed or not, can they be downloaded, ...).
Comment #10
Susurrus CreditAttribution: Susurrus commentedIt would be much nicer if discussion of unrelated topics were discussed in separate issues so we can keep things orderly.
Regarding this issue, what bugs did you find in the code?
Comment #11
Susurrus CreditAttribution: Susurrus commentedSo there're about 30 different comments and suggestions in this issue, but very few have to do with the topic. Documentation does have to be improved and I've created a task for it, but this isn't the issue to comment on everything that's with this module. The way to deal with this is to create a new issue for each problem or suggestion. It takes all of 3 minutes to do and it makes things a lot easier.
Since there's no patch and I've changed the code so much from the base you were working with, I can't test your code easily clauded. Posting a screenshot would help. Depending on how this looks, I may "won't fix" this.
Comment #12
clauded CreditAttribution: clauded commentedWhat I propose is to display the description as part of the table display (instead of displaying at the top of the table) so we have "filename-file size-file description", a more natural way of displaying content. If you agree to make this part of the module, I can use RC5 as a base and post it here.
See the screenshot attached.
Comment #13
Susurrus CreditAttribution: Susurrus commentedI think this would be reasonable. I'd only be worried about how the text will wrap when the description is too long. If you roll a patch, I'll commit it.
Comment #14
clauded CreditAttribution: clauded commentedHere's the revised version of the module based on RC5. Please note the following changes :
- description is displayed as part of the table (description column will appear even if no descript.ion file present)
- corrected a bug that prevented directories description to be listed
- nb of files and total file size has been moved after directory listing so it looks more consistent with usual file browsers
Long description will wrap into the column max. width within page display.
Comment #15
Susurrus CreditAttribution: Susurrus commentedI'm still against the details of a directory being displayed at the end. Excluding that change, I'll review this and commit it if it works.
Comment #16
dman CreditAttribution: dman commentedJust a note, AFAIK, descript.ion file should not be delimited by ":"
The format, as I've encountered in several applications over the years (ACDSee, Newsgrabber, maybe others) is whitespace-delimited, with the filename quoted if needed. If you know of other conflicting examples, I'd be interested.
The regex where can be adjusted to allow : OR spaces, to maintain a semblance of compatability, but if it's to be used, it should at least be portable with other loosely-defined examples already in the wild.
I've been using a similar approach as an enhancement to image_import
Comment #17
Susurrus CreditAttribution: Susurrus commentedI'm a new maintainer to this project and created the 6.x branch from scratch adding features back in from 5.x that were needed. I didn't know about the descript.ion format, but found a reference to it here: http://www.leeholmes.com/blog/AddFileDescriptionsToYourDirectoryListings....
Looks like the following will work for space-separated descript.ion files. I see no point in supporting colon-delimited files as it's a trivial fix to do at a command line and backwards compatibility must end at a point. The 6.x-2.x isn't afraid to do that.
Also, everyone likes to clutter up issues with other issues. It's damn annoying....stop. Make a new issue for things like this instead of turning an old one down a sidepath. I appreciate you wanting to contribute, I really do. But contributing in this way doesn't really make things easier, just more difficult.
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedIn some non-UNIX systems
:
isn't allowed in file names. In thedescript.ion
file:
should be used neither in file names nor in descriptions. I prefer:
instead of space.Comment #19
dman CreditAttribution: dman commentedSorry if you thought that was off-topic, I was responding to the Original Post, Post #1, and the issue which started this thread.
I see the topic has drifted a little bit since then, but I only noticed it in the tracker now, so thought it was trivial to point out.
descript.ion is a pre-existing format that I've encountered in several contexts, not something to be made up from scratch. I'd rather it stuck to the simple format it is rather than be turned into something else. That reference linked above seems to match my expectation of the syntax...
It seems simple enough to support at the stage this module is now, so lets just see if we can be liberal in what we accept ;-)
Sorry my if addressing the original topic was annoying...
Comment #20
Susurrus CreditAttribution: Susurrus commentedSince a space is the common delimiter and there are enough deviations from "standards" to make any web developer scream, I think that's what the new delimiter will be.
So #14 is still the code to test.
Comment #21
Anonymous (not verified) CreditAttribution: Anonymous commentedThat's okay and it works with the latest version of filebrowser.module but we should have a description for the current folder above the table. This text should be in the descript.ion file.
Comment #22
Susurrus CreditAttribution: Susurrus commentedDefinitely the description should be above the table. CNW for the changes suggest in #15, #20, and #21.
Comment #23
Anonymous (not verified) CreditAttribution: Anonymous commentedTitle
A space as delimiter is okay. :-)
With the directory description I mean a short text about the content of the current directory (general description) as an addition to the file descriptions in the table.
Because of the files summary I'm with Claude. I've moved the number of files and the size at the bottom of the page. ;-)
Comment #24
Susurrus CreditAttribution: Susurrus commentedSince everyone seems to be commenting in this issue, has anyone had problems with rc5 so far with respect to Cron or subdirectories displaying, private downloads, clean URLs? I've tested it, but between rc3 and rc4 a lot of issues popped up and I thought I addressed them all. I didn't mean for the number of RCs for this release to get so out of control...
Also, Fine! I'll move the files/size description to the bottom since everyone seems intent on complaining :-).
Don't forget to check out #298385: Add PDF file icon as I plan to incorporate that into the next RC too.
Comment #25
Susurrus CreditAttribution: Susurrus commentedDone.
Comment #26
clauded CreditAttribution: clauded commentedIn the latest dev build (v 1.9.2.8.2.33 2008/08/24 17:15:04), no description is displayed. Is this on purpose ?
Comment #27
clauded CreditAttribution: clauded commentedSorry for the previous post : I edited my descript.ion files to remove the ":" so now it works :-)
Comment #28
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.