Wikka Mod 015
Type: Feature AdditionThis is the info about the version of the {{files}} action currently included in Wikka.
- For the development page, take a look at FilesAction.
- For a documentation of how to use the current version, look at FilesActionInfo.
Credit:
VictorManuelVarelaFiles Action
This action allows easy file uploading/downloading from a wakka page.All you have to do is:
- set $wakkaConfig['upload_path'] to a writable directory: a directory by each page will be created to store their attached files.
- add {{Files}} to the page content: a form to upload files will be shown to users with write access.
- insert {{Files download="filename" text="descriptive name"}} to show a link to download every file.
- if you want to recognize mime types, you must set $wakkaConfig['mime_types'] to a file like this
Note: The mime_types file HAS to exist. If it doesn't, the pagehandler writes "ERROR: unreadable file mime.types" at the beginning of the file you want to download - not to the browser screen, as it should. You have to create an empty mime types file in the Wakka root directory, like "touch mime.types"
--TobiasHesselmann
Furthermore, when I try to delete files, I get the following error:
Unknown method "page/files.xml?action=delete.php"
Strange...
It seems that only the wikka admin (and not all users with write privs) has access to the upload form. Is anyone else experiencing this problem?
There's also an issue with space usage. Someone could upload many, many files and use up all of a site's space.
If a Wikka admin is not watching her site, these could be serious issues.
So, I chose to make it so that only admins can upload files, by default. Of course the code can be tweaked to allow others to upload. Maybe there should be a configuration option that would specify upload access.
While I understand your concern (I share it) I'm not happy with WikiMasters needing to "tweak code" to enable/disable a feature.
Should be a configuration option, IMO. (IOW, allow a WikiAdmin to do it, rather than having WikiMaster edit code - see WikiRoles! After installation and initial configuration it should not be necessary to hack code).
(repost - wish I could *edit* my own comments!)
- allow only registered users to upload files
- give make it so that files are automatically uploaded in a "user's" (sub)directory
- give users a quota over which files can no longer be uploaded
Something like that would probably address most of the concerns - at least *limit* any "damage".
- allow an Admin to receive a notification by email whenever a file is uploaded ("allow" means making this a configurable option)
- create an RSS feed for all uploaded files
- add a "RecentlyUploaded" to the RecentChanges and RecentlyCommented options we have now
However, another way of dealing with the issue is to have the "fileupload" action added to a ""FileUpload"" page which could be created automatically when wikka installs (to a page where permissions are set, by default, only for the administrator to edit), and then the file upload script could be modified so that by using the parameter "users=name1, name2, name3" the administrator could designate other people who could upload from that page to a common directory. I've had Mark do this for several of the actions we've developed (not my image upload one as we dealt with security the way previously described) and it works quite well for allowing a designated list of users for an action (I know this approach violates some broadly accepted "tenet" of wiki use....but our interest was in sharing the use of tools amongst people in a project while maintaining the security for other content on the page). -- Mike
it has to be discussed if this functionality is going to be in the next wakka and then if we can/should have a wakka_files table, i suppose ...
I am still new to Wikka and didnt look at the code a lot yet, so if I this impossible (or there is something like that built in already but I just didnt see) excuse my 'stupidity' please.
What I would suggest is to have two links in the header/footer menus: the first one would allow to upload files (depending on the authorizations), the second link would only be displayed when there are attachments in the upload folder for this page.
Maybe we need both an action (display list within page) and a handler (allow upload/rename/delete)?
It would be more useful, I think, if someone could use it to only show "relevant" files or "their own" files - which needs more management than we currently have with just a single upload directory.
Also note that the current files action does have parameters for just creating a link (something a handler could/should not do) so it's halfway there.
Could anyone tell me please how I could modify files.php to only allow upload of .gif .jpg or .png files?
I'm having trouble getting the files action to allow users to upload large files. I have modified the $max_upload_size variable in "actions/files.php", but to no avail. It looks to me like the action is supposed to give descriptive error messages (i.e. File too large, file name already exists, etc.) but those never show up. If I try to upload a big file (>2MB) the connection just hangs.
Thanks,
Patrick
TmO
Others -- including JavaWoman if I remember correctly -- were in favour of a system in which file uploads are handled by a system completely independent from pages (similar to MediaWiki in this respect), with access control and permissions tied to users instead of pages. This would have totally different consequences in terms of design on how to refer to or embed a file in a page.
I'm afraid we haven't moved much further than this - you may want to take a look at the trunk version for the current status of implementation of file uploads.