Loading...
 
Skip to main content
Part of this page should merge with File Gallery and the rest should be included in the Admin Guide

Admin Access

To access administration you need Admin permissions. From the main Menu: click on "Admin" or "Admin" > "Admin Home". You can also use the quick access Image "Home" icon from the Module QuickAdmin module (located on top right by default).

Activate the Feature

The feature is activated by default on new install. If not, activate it on the "Features" admin panel.

File Galleries

Image


From the main "Admin" panel, click the File Galleries icon to display its settings panel, the top of which appears like so (with "Basic" preference filter) in Tiki 12.x:

Click to expand
Click to expand


To see some advanced settings select the "Advanced" checkbox on top in the preferences filter. Then you can select the home file gallery, the comment settings for file galleries and if rankings/comments are used or not for file galleries, etc.

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 in the database
  • Store files in a directory


The differences and settings needed for each option are explained below:

Storing files in the database

If you decide to store files in the database then each file data will be stored in a database table (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 it more difficult to make backups/dumps

Storing files in a directory

If you decide to store files in 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/
/var/www/tiki/files/
/home/tiki/files/
files/uploads/

It is recommended to store your files in a non-web accessible directory. Thus, even by guessing the file hash (a long code), it's not possible to access the file without going via Tiki, and the relevant group / permission mechanisms.

Storing files in a directory has the following advantages and disadvantages

  • You must configure properly a directory to store files (chmod 777 for folders/directories, chmod 644 for files. Otherwise you will get error like "I/O error", "server error" or "error 401")
  • 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 in it
  • For security, only Tiki can read or access the contents of that directory. Do that with one of the two following options.
    • Use a directory outside the webserver DocumentRoot (so the users won't be able to list the directory)
    • Use a directory inside the DocumentRoot (relative to the Tiki dir for example) and prevent listing the directory using a .htaccess file or other configuration depending on your webserver.


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 😊 choose the strategy that is best for you.

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 >=4
It 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 no 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.

tw >=5
The 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 may be incomplete (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 use.
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.

Parameters for images

Since Tiki6, there are a few parameters related to set the maximum size for width and height of images once uploaded to that file gallery, as well as the default syntax to be added in the wiki page (or any other textarea) when the user selects an image from a file gallery through the image buttons in the toolbar at the wiki edit page.

Click to enlarge
Click to enlarge

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

Please see Search within files

Automatic deletion of old files

tw >=5.0
If you check this feature, the user will be able to say after how much time his file can be deleted automatically after the last file update
When the file will be deleted a mail to emails will be automatically sent with the deleted file attached. The emails are comma sperated email.
in order to have this feature working you must step up a cron job.
Create a file like that in Tiki root:

Copy to clipboard
<?php include_once('tiki-setup.php'); if ($prefs['fgal_delete_after'] == 'y') { global $filegallib; include_once ('lib/filegals/filegallib.php'); $filegallib->deleteOldFiles(); }

Fix mime types based on file suffix

Under some conditions (combination of browser, web server, upload method), uploaded files get the mime type application/octet-stream instead of image/*. When activating this setting, the suffix of the uploaded file name will be used to override the mime type application/octet-stream. The following suffixes are recognized (case insensitive):

  • .jpeg and .jpg will set image/jpeg
  • .png will set image/png
  • .gif will set image/gif
  • .tif and .tiff will set image/tiff
  • .pdf will set application/pdf
  • .svg will set image/svg+xml

Admin view

Administrator can use an admin view of the file galleries.
This view has its own column display settings. All in the file gallery and its sub-filegalleries are displayed. The explorer is automatically hidden. In this view additional filtering are possible:

  • Not modified since
  • Not downloaded since
  • Orphans will shows only files that are not referenced. Careful: this feature is not perfect, some links can miss

User parameters

tw >=6.1 - from this version the various labels used to describe who has done what have been updated.

When setting what is displayed for either the general user or the system Admin the following options are available:

  • Created/Uploaded: displays the date the item was originally added to the File Gallery
  • Uploaded by: displays the user that uploaded the latest version of the file
  • Last Modified by: displays the user who last updated any of the file's Properties or uploaded a new version
  • Last Modified: displays the date that the last modification took place
  • Creator: displays the original creator of the file

The display column 'Creator' should only be used if the feature_file_galleries_author preference is set 'on'. This option then allows a text field to be used to capture a description of the creator of the file, if different from the 'Uploaded by' user - where this text is not automatically changed when a new version is uploaded. Please note that this preference is currently somewhat ambiguously labelled "Require file author's name for anonymous uploads" in the File Gallery admin screen

Setting the maximum upload size

Podcasts

These types of files allow you to have a file directly accessible from an url
ex: 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

Troubleshooting

  • When you download a file, if you get an invalid file: In Linux you can check if the file is correct and does not contain error messages with hexdump -C your_file

Alias

File Galleries Config


Created by system. Last Modification: Sunday 21 July, 2019 16:02:37 GMT-0000 by Yves Kipondo.

Attached files

ID Name Comment Uploaded Size Downloads
28 MySQL Max Allowed Packet.PNG Ed 14.15 Kb 1323