Wiki source for FilesActionInfo

Show raw source

=====Files Action Documentation=====
This the documentation page for the Files action.

If the WikkaWiki directory tree is copied or moved from an old system to another system that has SELinux enabled (enforcing) then the copied/moved files and directories may not have the correct SELinux context types. If this is the case, the ##""{{files}}""## action could be prevented from working correctly by SELinux enforcement even if the owner and permissions are already set correctly.

The ##actions/files/files.php## script file (and possibly other .php files in the WikkaWiki install directory) must have the SELinux context type ##httpd_sys_script_exec_t## to permit use of the PHP file creation routines. Without the correct context on the script, file uploads may fail. From the wiki base install directory, check for the correct SELinux context by entering the command:

ls -Z actions/files/files.php

If the listed SELinux security context type is not ##httpd_sys_script_exec_t##, change it with the command:

chcon -t httpd_sys_script_exec_t actions/files/files.php

Assuming the permissions and owner on the ##uploads## directory are correct, the entire ##uploads## directory tree must have the ##httpd_sys_script_rw_t## SELinux context type so that scripts (.php files) running in the web server process are allowed read/write access. Check this with the command:

ls -dZ uploads

If the listed SELinux security context type is not ##httpd_sys_script_rw_t##, change it with the command:

chcon -R -t httpd_sys_script_rw_t uploads

//Thanks to Mike Shultz and [[]]//

>>**See | also**
[[ Mod for the files action]]
For the development page, take a look at [[ | FilesAction]].
[[ | FilesActionSafeModeWorkaround]]>>::c::


==Short description==
Allows admins to manage files (upload, deletion) and everyone to view a list of them or download them. Or it provides a download-link to a single file.

""<table cellspacing="0" cellpadding="2" border="1">
<tr><th scope="col">name</th><th scope="col">type</th><th scope="col">required?</th><th scope="col">default</th><th scope="col">description</th></tr>
<tr><td>download</td><td>string</td><td>optional</td><td></td><td>prints a link to the file specified in the string</td></tr>
<tr><td>text</td><td>string</td><td>optional</td><td></td><td>a text for the link provided with the parameter "download"</td></tr>

==Long description==
The 'upload_path' in the [[ConfigurationOptions | wikka_config]] must be a writeble directory. A directory by each page will be created to store their attached files. This action will only show/modify the files attached to the current page!

If you want to manage the files, use the action without parameters. You will see a list of the files attached to wikka with "attachment" (name of the file)., "size" and "Date added", ordered descending after "Date added". To donload a file, simply click on the name. As an [[WikkaAdmin | admin]], you will see a "x" left to every file (clicking on it will delete the file). The simple form below the list allows to upload a file.

If you specify a filename with the parameter "download", a link to download this file will be shown (you can change the text for the link with the parameter "text") but not the form.

%%{{files [download="filename"] [text="descriptive text"]}}%%

==Upload limits==
As for a default install, a limit of 2 Megabyte for the (maximum) size of a file exists. You can find it in

// if(!defined('MAX_UPLOAD_SIZE')) define('MAX_UPLOAD_SIZE', 2097152);
if(!defined('MAX_UPLOAD_SIZE')) define('MAX_UPLOAD_SIZE', 4194304);

If you want to enhance the limit you can do so by changing the file (note that the limit has to be written as a number of bytes).

Please note that PHP itself imposes a limit on file-uploads. You can find the parameter in the


with a default set to 2 megabyte.

[[ | VictorManuelVarela]]

Valid XHTML :: Valid CSS: :: Powered by WikkaWiki