Closed (fixed)
Project:
Filebrowser
Version:
6.x-2.x-dev
Component:
Directory Listing Pages
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Jul 2010 at 14:31 UTC
Updated:
30 Sep 2012 at 23:01 UTC
All folder listings are lost after upgrading to 6.x-2.0-rc12. I've been running update.php, as usual.
The files still exist in teh filesystem (even if I never understood where this module puts what)
Greetings, -asb
Comments
Comment #1
asb commentedAddition: The "Metadata" tab still lists the (sub-) directories.
The files in the "audio" directory are owned by the webserver user.
Also, there is a descript.ion file in each subdirectory, but it's contents is not evaluated by the "Metadata" tab (the metadata textfields are empty).
Comment #2
clivesj commentedDo you mean that nothing is listed?
I had the same thing, but it appeared i had to re-configure the folder options.
So enable the checkboxes and your listings should appear again.
Comment #3
asb commentedThanks, switching to "icon view", then saving, then switching back to "llist view" does the trick.
Now the previously uploaded files are listed again. But I'm getting the following warning:
Probably this causes that sorting by Display name does not work. Edit: #841372: usort() Invalid comparison function - Upgrading to dev version.
Also, the texts from the descript.ion files still do not appear in the "Metadata" tab (not sure if they should).
And, last but not least, the listed files can not be downloaded (404, file not found error).
Thanks & greetings, -asb
Comment #4
asb commented6.x-2.x-dev deliver additional errors:
The "Display name" error is nox fixed in the dev version.
Also, it breaks the theme. Great.
Comment #5
Yoran commentedWhat is the field you are sorting (in the URL sort parameter) ?
Which php version are you using ?
Is it possible for you to insert an "error_log($code)" just before the erroneous line and giving to me what you have ?
Anyway sorry if I have brake things, I'll try to fix as soon as I can.
About where i'm storing information, well, this is an original drupal design problem that no one want to care about :) Modules can store settings or content just in any place they want... Each developer got his strategy where we should have a real storage api. anyway, all information are stored in 2 tables :
- node_dir_listing that is associated with drupal node table and contain all per node settings. Actually my strategy is just to have 2 plain fields (nid et folder_path) and a blob containing all serialized information.
- node_dir_listing_content which contains a mirror of all files/folders found in node. I had to create and maintain this table in order to solve many encoding problems.
Comment #6
asb commented> What is the field you are sorting (in the URL sort parameter) ?
http://.../node/218?sort=desc&order=Display+name
> Which php version are you using ?
> Is it possible for you to insert an "error_log($code)" just before the erroneous line and giving to me what you have ?
The error was:
If 218 and 223 are the line numbers, I'm getting this after inserting
error_log($code)at the two locations referenced:Inserting
error_log($code)before line 1 makes no sense because line 1 is:<?php.Regarding storing the data: I'm putting the files into
/audio(in the root of the Drupal installation); however, there's also a directory at./sites/default/files/filebrowserthat I haven't created (with two subdirectories:archivesandobscurity_links). I have no idea whatarchivesis, and I can't find a setting to configure/remove theseobscurity_linksin the current -dev release. This is a bit confusing but no major issue (some documentation what to expect would help)Thanks & greetings, -asb
Comment #7
asb commentedChanging description and status (the module does not work at all in the current state)
Comment #8
asb commentedAny updates on this issue?
Comment #9
verta commentedI am seeing this error in beta 12, on a folder with an underscore in the name, not spaces:
* warning: usort() [function.usort]: Invalid comparison function in []sites\all\modules\filebrowser\filebrowser.theme.inc on line 201.
* warning: usort() [function.usort]: Invalid comparison function in []sites\all\modules\filebrowser\filebrowser.theme.inc on line 205.
#841372: usort() Invalid comparison function is also discussing this.
Comment #10
Yoran commentedNormally this is fixed in last dev
Comment #11
asb commentedSorry, in filebrowser 6.x-2.x-dev from 2010-Sep-07 this issue isn't fixed completely.
E.g. downloads are still completely impossible.
As well if the file includes whitespace characters which aren't handled at all, as it seems, as with filenames like "saudade_cd_2nd-cut_14.mp3" (watchdog logs: "file not found", but the path is correct).
As far as I can see, the latest dev release isn't operational at all, except that it creates directory listings (which can't be used for anything since downloads are impossible).
Comment #12
Yoran commentedAre you sure you are using the right download manager ("private" if you folder in under drupal root, "public" else case ? ).
Comment #13
asb commented> Are you sure you are using the right download manager ("private" if you folder in under drupal root, "public" else case ? ).
Yes, the "downloads" folder is under Drupal root. And no, I wasn't aware that the "private" download method would be a requirement. I've changed this, but the behaviour doesn't change.
Comment #14
Yoran commentedOh god, I should get some sleep before answering, sorry.
private - You chose this when your files can be access by Apache but can't be accessed by a direct URL. This is typically the case when the folder used by a filebrowser node is outside drupal root (ex. /storage/download). But the target folder should be readable by Apache. So when filebrowser receive URL http://yousite/filebrowser/download/XXX, it will locate XXX as a file, and if PHP can access it, will read it and send it byte per byte to web client. So the file is served by PHP.
direct - You choose this when your files can be access trough a direct URL. This is typically the case when the folder used by a filebrowser node is outside drupal root (ex. sites/files/downloads). As private mode, files should be readable by Apache. So when filebrowser receive URL http://yousite/filebrowser/download/XXX, it will send to web client a Location header (redirect) in order to let Apache directly serve the file.
Ok that's for the theory :) Practically, I fixed a problem with direct download for people who was setting "inside drupal" root as a relative path to drupal root. So if you can give a try to the next dev version, set your download mode to "direct" (as your download folder is under drupal root) and tell me what's happen ?
Comment #15
asb commentedThanks for the clarification. I upgraded to the current dev release, cleared all caches (through drush), but the behaviour didn't change.
Any other ideas?
Comment #16
greywolfsspirit commentedI didnt scroll up to check on this, but, by chance did you check your admin/settings/file-system, under download method? Is it set for public or private?
Download method:
Public - files are available using HTTP directly.
Private - files are transferred by Drupal.
Choose the Public download method unless you wish to enforce fine-grained access controls over file downloads. Changing the download method will modify all download paths and may cause unexpected problems on an existing site.
Comment #17
Yoran commentedThe last test I can thing a about is can you download your file using a normal URL, meaning http://yoursite/path/to/your/file/yourfile ?
Something else that can be source of problem : did you check you have a table called node_dir_listing_content and can you find the file you try to download with the right path and nid in it ? when you found this file, the fid column value should be the same as XX in filebrowser/download/XXX link.
if it was a global download problem I imagine others should have it to. So if this test succeed, we can have a try at your configuration by telling us which OS your are using, wich PHP version, etc.
@greywolfsspirit well actually private/public mode don't change that much if your files are inside drupal root. First I tought as you do that drupal was kind of changing son .htaccess to block such download, but it seems not to :) But why not give this a try asb, using public mode for drupal AND filebrowser.
Comment #18
Osik commentedHi Yoran, Hi asb,
I'm expecting the same behaviour like asb. In my drupal root folder I have a folder called docs. If I fetch, wget or what so ever the URL http://www.somesite.com/docs/myfile.ext there is no problem. The file is served by Lighttpd. If open the URL http://www.somesite.com/docs in my webbrowser I get the listing of all files in that docs folder. But trying to download gives me an 404. This seems to be happen, because the filebrowser module rewrites the url from http://www.somesite.com/docs/myfile.ext to http://www.somesite.com/filebrowser/download/XXX where XXX is an NodeID.
Setting the downloadtype to direct or private makes no difference.
Any help is appreciated.
Comment #19
asb commented@Yoran: Yes, downloads circumventing the filebrowser mechanism do work fine. The OS is Debian "Lenny", the PHP version - well, would you please have a look at #6 from July 2, 2010?
> did you check you have a table called node_dir_listing_content ...
I have one table
node_dir_listing_contentand another one callednode_dir_listingThe first one indeed contains the data from the filebrowser listing; sample excerpt:
I never fully understood the mechanics of the Filebrowser module, but this looks strange to me: Two different file ids are pointing to the same "path", but are coming from a different "root". However, other directories have the same "structure" in this database table, so probably this is how it is supposed to be?
> and can you find the file you try to download with the right path and nid in it?
> when you found this file, the fid column value should be the same as XX in filebrowser/download/XXX link.
Sorry, the that part I do not understand. What would be the "right path"?
@Osik: I'm running Apache, so at least it's not an issue with those incomplete Lighty rewrite rules ;) you're still on FreeBSD?
Comment #20
Yoran commented@asb nothitng difficult in this table. You have 2 ids for the same "file" because FID:275 means "Saudade folder in / folder" and FID:277 means "Saudade folder as a dot in Saudade folder".
When you fly over this mp3 file do you have /filebrowser/download/301 as this 301 is the FID for the file you need to download.
If this is correct, the last thing I see is a problem with the redirection from http://yoursite/filebrowser/download/301 to plain URL you checked. So tell me and I'll modify the way make dowload URL.
Comment #21
asb commentedIf I'm hovering over the link on saudade_cd_2nd-cut_09.mp3 (physically stored in the folder /var/www/mysite/audio/Saudade) when being on http://mysite.tld/node/218/275, I'm getting the URL http://mysite.tld/filebrowser/download/301. The URL http://mysite.tld/filebrowser/download/301 results in a 404 "not found", while http://mysite.tld/audio/Saudade/saudade_cd_2nd-cut_09.mp3 immediately downloads the file.
Node node/218 is configured as follows:
Comment #22
Yoran commentedOh yes, I think I have it... You use an absolute path instead of a relative one, for a apache served directory. "normally" if in your case drupal root is /var/www/aem, path definition should be just "audio". I made a patch for this, I hope next dev will fix your problem.
Comment #23
asb commented> You use an absolute path instead of a relative one, for a apache served directory.
> "normally" if in your case drupal root is /var/www/aem, path definition should be just "audio".
Hm, the description of this setting seems to be pretty clear: "The system file path to the directory. This can be an absolute path or should be relative to the Drupal root directory.. However, if I use a path relative to the Drupal root directory, downloads start to work. So correcting the description ("...must be a path relative to the Drupal root directory") would suffice, but a proper fix is even better, of course. Changing the status to "fixed".
Thank you!
Comment #24
Yoran commentedYou're welcome :)
Normally my fix handle absolute path with public download now. So the description should be ok like that :)
Comment #25
the fatness commentedI previously posted this http://drupal.org/node/910218 and assumed all worked fine after restarting IIS.
I was wrong, just the error disappeared, now I am unable to download any files. The listing appears, but I am unable to download anything it just sends me back to when any files are clicked.
I am able to access them directly mysite.com/d/files/file.ext where /d/ is my drupal install directory. I have it set for Public and my installation is as follows:
Windows Server 2003 / IIS 6.0
PHP 5.3.3
Drupal 6.19
Filebrowser 6.x-2.x-dev release date: 2010-Sep-11
Comment #26
the fatness commentedafter much troubleshooting, and setting it to private it works. no clear steps on what i did, restarted server, and IIS a few times changed all settings within.
Comment #27
asb commentedRe #23 - I had filebrowser-6.x-2.x-dev from 2010-Sep-19 running for a while with a relative path (relative to Drupal's root on the webserver). As reported in September, this worked.
Without changing the configuration, it suddenly stopped working again. The behaviour went back exactly to the status described in #11 (no files can be downloaded because of "file not found" errors).
Next I changed the "system file path to the directory" from relative to absolute (this is the configuration that used to not work). Now files can be downloaded again, at least there are no "file not found errors" anymore at the moment. I absolutely don't understand what is happening here.
Furthermore, when clicking on an audio file, the file is not being downloaded by default, but a audio player opens in the web browser; I believe that the "Filebrowser" module serves a wrong mime type.
Last but not least, the audio file is not being played, but the browser stopps responding (checked with Opera and Chromium under Ubuntu "Maverick"). Windows users could do a right mouse click on the file and choose "Save as", however this doesn't work for Apple users.
Reopening.
Comment #28
Nicolas Georget commentedNot from a wrong mime type. It comes from a wrong header option called on the function
filebrowser_filebrowser_download_manager_process()in the file filebrowser.module (line 909 and 912):Change header('Content-Disposition:
inlineattachment; and same for line 912. (i.e. #924856: File as Attachment or Inline)In the filebrowser-6.x-2.x-dev from 2010-Sep-19 version, there's another bug that truncates file name : http://drupal.org/node/924812#comment-3501576
Finally, there are big confusing codes about the Direct/Private download options #924988: Zip Archive created and download it but i have to let Yoran explain to us.
Btw Yoran if you hear this, there are a lot of bug reports that could be duplicated ;-)
Comment #29
Yoran commentedOh yes I know, I have so little time to maintain this module, I let you imagines for duplicated issues ;-)
About this story of direct/private download, asb, if you still have the problem, can you give a try to the rc13 (oh god..) I'll try to create tonight (as soon as I understood how to do this with git ;-)
Comment #30
Yoran commentedNo news good news ?