Hi,
I've posted this in the forum and was advised to move it as an issue:

I am trying to display a list of all the files I have uploaded into my webfm directory structure.

To do this I have created a view which runs the following query:

SELECT DISTINCT (files.fid) AS fid,
files.filename AS files_filename,
files.filepath AS files_filepath
FROM files files

This view's display however returns only files which supposedly reside in my "files" directory , although there are many other files in sub directories of "files" (created using webfm).

I am saying "supposedly" because none of the three files returned by the view are still there: the two files in the "files/temp" directory are no longer there but the views keeps showing them even after I cleared the cache; the third file is a file that was erased long a go but still show as if it is there (yes, I ran crone, update, and cleared cache)

Permission on "files" is 777 and on the subdirectories 775. so I tried changing some of the subdirectories recursively to 775 but this did not change the view on bit.

My question therefore is why does the view not show the files in my subdirectories and why does it show files that no longer exist?

Would very much appreciate help here.

Comments

robmilne’s picture

Status: Active » Closed (works as designed)

WebFM doesn't use the 'files' table. It uses the 'webfm_files' table.

lilon’s picture

Thanks very much for the quick answer. I thought it must have had something with the way webfm stored location of files.

Do you have an idea how I can still use views to list files. I am not given an option in views to fiddle with the sql.

thanks

robmilne’s picture

There is a views component for WebFM (which I didn't create) and an example of usage at http://webfm5.vera-ikona.com/webfm_attach_nodes (you need to create an account). I've always created my own queries/modules when I needed them. Also, views queries are not very efficient so I've always taken a dim 'view' of them.

lilon’s picture

thanks very much for that. It works great. I searched for a d-6 version and a "first" simple patch was submitted 3-4 months ago by Frank Steiner but no feedback since then. Unfortunately, the learning curve of customizing drupal modules is beyond my abilities at the moment, I will have to wait for some more feedback/developments.

thanks

tavin.cole’s picture

What is the rationale for not using the 'files' and 'upload' tables?

Couldn't WebFM's additional information be stored in auxiliary tables that JOIN with 'files' and 'upload'?

robmilne’s picture

Neither has any concept of file permissions/file versioning/metadata/download count. I suppose this data could have been encapsulated in other tables but I really wanted to insulate my implementation from the upload module and its flat filesystem.