Hello everyone. I have uploaded to CVS versions for Drupal 4.3 and 4.4 of a module I've been developing to allow users to view and download files from an existing directory structure. It's similar to Apache's indexing functionality but is controlled within Drupal (user access, etc). It also includes a page for users to track additions to the file archive.

I've found it useful. Let me know what you think...

Thanks,
Spoopin

Comments

moshe weitzman’s picture

this sounds like the image gallery module that i've always wanted. just ftp to a directory structure and then you're done ...

addf’s picture

I find quite interesting this new module, but I've tried to make it work with the CVS version of Drupal and I cant find anywhere how to see the files which are at the fileserv directory configured at the admin section.

Any hint what I could be doing wrong?

Thanks in advance,

Antonio.

spoopin’s picture

Sorry not to have gotten back to you sooner. I've not yet make this module complient with the Drupal CVS version. There are current releases for both Drupal 4.3 and 4.4. I'll post here when I have a working release for the CVS version...

pss0ft’s picture

Hi,

Where can I find this module for the version 4.4 of Drupal? I searched but I did not find it.

Grtz. Henk

WebSite powered by Drupal: http://pd5dp.ham-radio.ch
Other WebSite : http://www.qsl.net/pd5dp

Email:
pd5dp@amsat.org

pss0ft’s picture

Hi,

Just announce that it works on my website at http://pd5dp.ham-radio.ch

I work with Drupal 4.4.2 at the moment. Little remark about installing.

Remark #1
There is a file supplied (CVS section of FileServ) which is a textfile with a lot of lines in it. Where are these for? What purpose have they? And it would be nice if there would be created also a normal record addfile instead of the line in the creating-table-file which tries to insert this file into the table just created. I type it by hand, because there was no way it worked as it was supplied.

Remark #2
Some additions to this module would be nice. A better menustructure. For example directly the new files instead of a screen which tell you to use the links underneath the fileserv menu. Also date/time of the file or dat/time when the file was added. Maybe a description of the files?

Makes this some sense?

Grtz. Henk

WebSite powered by Drupal: http://pd5dp.ham-radio.ch
Other WebSite : http://www.qsl.net/pd5dp

Email:
pd5dp@amsat.org

spoopin’s picture

Thanks for trying it out. Here's a few questions/thoughts on your remarks.

As to remark #1
The purpose of this file is to more closely replicate the function of a web server by sending mime information with the file. Although it's a bit crude to rely on the filename extension to determine the file type, it seems to work well enough and defaults to 'application/octet-stream' when things go wrong. I can't figure out why the file wasn't loaded during installation, unless the user your db runs as doesn't have FILE rights. I'll look more into this, but if you could tell me what the specific error you're getting is, maybe we could figure it out.

As to remark #2
I like all of these ideas. I'm not yet running Drupal 4.4 myself, so the current menu system of my module is still underdeveloped. I intend to get to work on improving that soon. Adding the date/time of new files would be pretty easy. Descriptions, however, would not - but I won't rule it out for future versions...

Thanks for your comments, and keep in touch with any other bugs or ideas.

Matt R.
Spoopin

pss0ft’s picture

Hi,

TNX for the reply and great that you like my ideas. I am just a relatively newbie with PHP, MySQL and Drupal. The error I got was the first time something like that the MySQL version did not allow this command. When trying again with some variations of the command I got even an access error. Bottomline: I did not got it right.

About the ideas I have. I could come up with a lot more ideas regarding this server. How about userpermission based sections. That you have to belong to a user group (role) to access a specific directory.

What are you running? What is your website url? Just curious to see what you have created. My website(s) are underneath this message. The first one is powered by Drupal. I have some projects of my own. For example I want to extend the counter module I am using. This uses BBclone. Statistics. The creator gave me permission to try to extend the module so statistics can be viewed within Drupal. I wrote I am a newbie in PHP. So this will take some sweat to pull off.

Grtz. Henk

WebSite powered by Drupal: http://pd5dp.ham-radio.ch
Other WebSite : http://www.qsl.net/pd5dp

Email:
pd5dp@amsat.org

pss0ft’s picture

Hi,

Found a real bug. When going to the directory structure and pressing on the directory up link, than I got this error:

PHP Fatal error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''fileserv/files/\' and mid=1' at line 1 query: SELECT iid FROM menu_item WHERE url='fileserv/files/\' and mid=1 in C:\Webs\friends\pd5dp\includes\database.mysql.inc on line 97

I think the module wants to go up one directory while is is in the root of the files section. That may not be possible. So a bug. :-)

You asked me for it and you got one. Are you now a happy man? ;-)

Grtz. Henk

WebSite powered by Drupal: http://pd5dp.ham-radio.ch
Other WebSite : http://www.qsl.net/pd5dp

Email:
pd5dp@amsat.org

spoopin’s picture

I really didn't expect it to work at all running on Windows. I developed it on a Linux platform without too much thought to porting it to work with the Windows filesystem. I know that PHP makes some of those corrections automatically, but it would probably work better to not rely on them. I'll work a bit on that this week and submit an updated version.

Also, my own site is still a work in progress. I haven't make it public yet...

Matt R.
Spoopin

pss0ft’s picture

Hi,

TNX for the effort. It is not only when I try to get back further that the ROOT directory, but it seems going back to every directory results in this error.

You are welcome to try this out. No problem. When logging in just look al the leftside for the fileserver link at http://pd5dp.ham-radio.ch

Grtz. Henk

WebSite powered by Drupal: http://pd5dp.ham-radio.ch
Other WebSite : http://www.qsl.net/pd5dp

Email:
pd5dp@amsat.org

spoopin’s picture

I think I have the bug you posted about fixed in the latest release:
http://cvs.drupal.org/viewcvs/*checkout*/contributions/modules/fileserv/...

I plan to work on some of the ideas you had in the coming days as time permits. I'll post here when I next commit a version to CVS.

Matt R.
Spoopin

pss0ft’s picture

Hi,

Great work. It is OK now. I can browse through the directory structure without an error. You could consider to detect when the Rootdirectory is reached and than disable the l ink to go one level up. It has no purpose. :-)

Some other things:
1.
A link on every page straight to the rootdir. Maybe you could make a directory structure visible to be clicked. So you go directly from one dir. to a completly other dir.

2. The possiblility to upload files into that structure? That would be nice. Real nice.

3. Make also the icon in front clickable. Now it is only the file or directory name. This makes it more easy to navigate.

Grtz. Henk

WebSite powered by Drupal: http://pd5dp.ham-radio.ch
Other WebSite : http://www.qsl.net/pd5dp

Email:
pd5dp@amsat.org

youyouyu’s picture

There is a file supplied (CVS section of FileServ) which is a textfile with a lot of lines in it. Where are these for? What purpose have they? And it would be nice if there would be created also a normal record addfile instead of the line in the creating-table-file which tries to insert this file into the table just created. I type it by hand, because there was no way it worked as it was supplied.

六合彩 传奇私服 沥青 货架

pss0ft’s picture

Hi,

I am still impressed with the module, but I discovered an error. While selecting the first option in the menu for viewing the most recent files a got this error:

PHP Fatal error: Table 'pd5dp.fileserv_filetime' doesn't exist query: SELECT filename FROM fileserv_filetime WHERE mtime BETWEEN 1096143415 AND 1096144555 in C:\Webs\friends\pd5dp\includes\database.mysql.inc on line 97

I believe is is due to the missing of a table called fileserve_filetime. Could you give me the structure of the missing table and if needed all missing information?

TNX in advance.

Grtz. Henk

WebSite powered by Drupal: http://pd5dp.ham-radio.ch
Other WebSite : http://www.qsl.net/pd5dp

Email:
pd5dp@amsat.org

spoopin’s picture

Don't know how that table could have been dropped, especially if it worked before. The definition for the table is here:
http://cvs.drupal.org/viewcvs/contributions/modules/fileserv/fileserv.my...

After the table's been created, go to the the administration page and click the link at the bottom to force an update - this will re-populate the table.

Hope that helps...

Matt R.
Spoopin

pss0ft’s picture

Hi,

It works fine now. The table never excisted in the past. I did not delete it anyway. Strange enough it worked in the version before. Very strange, but I know for sure when I did install the module for the first time there was only one table created.

I hope you develop the module further. Maybe also with the option to upload files also. Would be nice. A description after each file is also nice. Together with all other discussed options it could become one of the classic modules for Drupal.

Grtz. Henk

WebSite powered by Drupal: http://pd5dp.ham-radio.ch
Other WebSite : http://www.qsl.net/pd5dp

Email:
pd5dp@amsat.org

spoopin’s picture

Hello all. I've got a new version of the module in CVS. It's still only working with 4.4 - I wanted to get some of the suggestions here implemented before moving on to that.

Here are some of the new features:
- Links in front of files/directories are now 'clickable'
- Modification times are shown with files/directories
- Users (with appropriate permissions) can edit comments to
be included with file listings
- Links across the top allow you to return directly to any directory
between the current one and root
- Additional option on the permissions page to allow users to edit
comments.
- Cleaner URL's: all files/directories are now accessed by ID number

I think that's about it. I'm still looking into role-based permissions for individual files and directories as well as upload capabilities (although uploading to an existing filesystem sets off security alarms with me). I think the upload capability already exists in Drupal, although I'm not sure about that.

Thanks to pss0ft for all the suggestions and testing and to Kevin Landreth for the mysql patch. Any other comments/suggestions are welcome.

Thanks,
Matt R.

http://cvs.drupal.org/viewcvs/contributions/modules/fileserv/?only_with_...

spoopin’s picture

Just to let anyone interested know that there's a new 4.5-compatible version in CVS. I've added support for role-based access to files and directories for both the 4.4 and 4.5 versions.

Matt R.

spoopin’s picture

Just to let anyone interested know that there's a new 4.5-compatible version in CVS. I've added support for role-based access to files and directories for both the 4.4 and 4.5 versions.

Matt R.