Table of contents
Admin Access
To access administration, go to Home Page and, on the Menu, click on "Admin (click!)".Activate the feature
To use file galleries, first you must activate the feature. Admin>Home>Features.
File galleries
From the Tiki Admin Panel, click the File galleries icon to display its settings panel, the top of which appears like so:
Clicking the File Galleries icon on the Admin Panel (see TikiAdminSettings ) takes you to the File Galleries settings.

This panel is almost identical to the image galleries panel. Select the home file gallery, the comment settings for file galleries and if rankings/comments are used or not for file galleries.
There's an important setting for the file galleries: the storage strategy for files. You can choose one of two options to store file gallery files:
- Store files on the database
- Store files on a directory
The differences and settings needed for each option are explained below:
Storing files on the database
If you decide to store files on the database then each file data will be stored on a database column (field) this has the following advantages and disadvantages:
- You don't need to configure anything else.
- You may have problems if you plan to store large files
- The database can grow a lot making more difficult to make backups/dumps
Storing files on a directory
If you decide to store files on a directory you must indicate the path to a directory where you will store files. The directory can be absolute or relative to the Tiki directory for example:
files/
/www/tiki/files/
/home/tiki/files/
files/uploads/
can be configured as directories.
Before 1.8.1, ending "/" was mandatory.
Storing files on a directory has the following advantages and disadvantages
- You must configure properly a directory to store files
- You can upload files of any size (if you have space)
You must ensure that:
- The configured directory exists and PHP (Apache) can read/write it
- For security, only Tiki can read or access the contents of that directory. Do that with one of the two following options.
[+]
You may need to ask your ISP/hosting service for an upload strategy and instructions if the ISP/hosting allows uploads (some PHP's have file uploads disabled for unknown reasons, maybe to prevent disk space consuming). Since Tiki can be configured to store fles on the database or a directory if there's a way to handle uploads then Tiki can use it
Move files between them
Since Tiki5 (and backported to Tiki4.2) you can move the file in the database to the file system and the other way round, which is very helpful when migrating a tiki from one hosting to another one, for instance.Quota
tw >=4It is possible to limit the volume that is uploaded to all the file galleries or a specific file gallery. A quota to a file gallery applies to this file gallery and all the file galleries under it.
As soon as the limit is reached not other files can be uploaded. The user will see an error message that the quota is reached. A mail can be sent via the Mail notifications feature.
Backlinks
tw >=5The objects where a file is used (through the plugin IMG, FILE, link containing tiki-download_file.php , dl, preview, thumbnail, thumb, display) are collected. Be careful, the list can not be complete (For instance, reference to a file in the layout is not collected).
When you want to delete a file, a warning is posted if the file is still in used.
If you check in 'edit->file gallery' 'Perms of the backlinks are checked to view a file', the permission checking will be changed. If you see on object that uses a file located in a gallery you can not see, you will be able to see the file. You will be able to download a file that is used in at least one object you can see.
Filtering file uploads
You can set up filters for filenames so filenames will be checked and maybe rejected depending on their filenames. Filters are regular expressions perl-like without the // delimiters.
Filename must match
A regular expression that must be matched to accept the file example [A-Za-z] * (filename can only have a-z letters)
For example, if you want to require that uploads must have a wordprocessing file extension, you could enter .*\.(odt|sxw|doc|dot|rtf|wpt|frm|wpd|txt|ODT|SXW|DOC|DOT|RTF|WPT|FRM|WPD|TXT)
Filename must not match
A regular expression that if matched rejects the file, example \.gif (rejects gif images note that the period must be escaped since we are using regular expressions) If you don't know anything about regular expressions just leave the fields blank and all the files will be accepted.
File galleries search indexing
If you want the files content of your files galleries to be accessible by a ))TikiWiki(( search, and if you have a script that extracts the file content into a text, you can associate the script to the Mime type and the files content will be indexed.If you want to search on files in the file galleries, you must provide handlers to extract the text for the file's MIME type. The commands, such as strings or pdftotext must exist on your server. The type-command associations are defined in the Admin->File Galleries page.
| MIME Type | System command | Ubuntu/Debian package with command |
| application/ms-excel | xls2csv %1 | catdoc |
| application/ms-powerpoint | catppt %1 | catdoc |
| application/msword | catdoc %1 or strings %1 | catdoc |
| application/pdf | pstotext %1 or pdftotext %1 - | pstotext |
| application/postscript | pstotext %1 | pstotext |
| application/ps | pstotext %1 | pstotext |
| application/rtf | catdoc %1 | catdoc |
| application/sgml | col -b %1 or strings %1 | bsdmainutils |
| application/vnd.ms-excel | xls2csv %1 | catdoc |
| application/vnd.ms-powerpoint | catppt %1 | catdoc |
| application/x-msexcel | xls2csv %1 | catdoc |
| application/x-pdf | pstotext %1 | pstotext |
| application/x-troff-man | man -l %1 | man-db |
| text/enriched | col -b %1 or strings %1 | bsdmainutils |
| text/html | elinks -dump -no-home %1 | elinks |
| text/plain | col -b %1 or strings %1 | bsdmainutils |
| text/richtext | col -b %1 or strings %1 | bsdmainutils |
| text/sgml | col -b %1 or strings %1 | bsdmainutils |
| text/tab-separated-values | col -b %1 or strings %1 | bsdmainutils |
Several tools can be used to extract search strings; many Unix sites have "strings", which can detect things which appear to be text within files although without the accuracy of more specialized tools.
Ensure that the system command entered prints its output to the screen (standard output) and not to a file. Try the command on a console and check the manual. E.g. you have to add a trailing "-" to pdftotext.
Setting the maximum upload size.
If your Tiki is hosted by an ISP, you'll need to find out how set the maximum upload size. If you have command line access, you'll need to adjust some parameters setting in your server's php.ini file. The example below shows an maximum upload size of 10 megabytes.upload_max_filesize = 10M file_uploads = On post_max_size = 11M memory_limit, max_input_time, max_execution_time must be appropriate
- file_uploads: Must be On
- upload_max_filesize: is the maximum of the sum of the sizes of all the files that you are uploading.
- post_max_size: ideally this value should be larger than the value that you set for upload_max_filesize. post_max_size is the upload_max_filesize plus the sum of the lengths of all the other fields in the form plus any mime headers that the encoder might include
- memory_limit: Only to be properly assign if --enable-memory-limit is on
- max_input_time:
- max_execution_time
php_value upload_max_filesize "10M" php_value post_max_size "11M" php_value max_execution_time 300 php_value max_input_time 300 #if the files are stored in the database, you can add the following line php_value memory_limit "64M"
If you change your php.ini, You will need to re-start your apache or other webserver for the change to take effect.
More info
If you are storing your files in the database, you need to check this MySQL variable:
max_allowed_packet
This variable can be located in the "my.ini" file as shown in the figure below.
The "my.ini" file is located in the same directory as your MySQL server install.
For example, on a development box, you may have installed it at:
"C:/Program Files/MySQL/MySQL Server 5.1/my.ini"
Open the "my.ini" file and find the [mysqld]] section.
If there is not already an entry for your "max_allowed_packet" variable, then add one as shown
in the figure above (e.g. max_allowed_packet=64M).
Make sure that you have enough storage allocated to your database to handle the size of your files!
Once you have added an entry to set this variable as in the figure above, save
the modified "my.ini" file and restart your MySQL server.
Again, on a typical Windows development box, you can locate your "mysql" service
(if you have it running as a service under Windows: Start->Run->"services.msc")
and simply right-click and choose "restart".
You can use the phpMyAdmin console to check the value of your "max_allowed_packet" variable.
Select the "Variables" tab on the main phpMyAdmin screen. Scroll down until you find the
correct variable, and then check that the value matches that which was set in the "my.ini" file.
See the figures below...
Podcast
This type of files allows to have file directly accessible from an urlex: http://mysite.com/podcast/1233243234234.mp3
In a regular file gallery, the files can be accessed with
ex: http://mysite.com/tiki-download_file.php?fileId=1
By preserving the extension, the file can be directly used in the rsspodcast and for podcast players
Trouble shooting
- When you download a file, you get an invalid file. In linux you can check if the file is correct and do not contain error messages with hexdump -C your_file
File Galleries Config
Contributors to this page: sylvie
,
jh
,
edmund
,
luci
,
awolff
,
mlpvolt
,
SEWilco
,
dthacker
,
xavi
,
BillFWhite
,
telenieko
,
,
xavidp
,
gg
,
mdavey
,
magius
,
mose
and
system
.
Page last modified on Tuesday 26 January, 2010 13:29:28 UTC by sylvie
.
Sidebar
Featured links
Last changes
Freetags editor
Sidebar
To register
To have an account at this site, please register at Tikiwiki.org
, and then use that user name and password to log in here.
