Loading...
 
Skip to main content

Custom Share Module 0.1dev

History: FileGallerySettings

Preview of version: 9

Configure File Galleries

Image


This panel is almost identical to the image galleries panel ( ImageGallerySettings ). 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

Uploading large files


If you do want to store files on the database you may have problems uploading files of more than 1MB, this is because MySQL has default packet limit size of 1MB, you need to change the max_allowed_packet setting for MySQL find the script that calls mysqld (the server) and add the option
-O max_allowed_packet = 16M

To support up to 16Mb files (for example). You may need to contact your database administrator in order to do this. If you want to store large files and have problems configuring MySQL you may need to store files on a directory.

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.

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:

  • PHP can read/write to the configured directory
  • The users can read or access the contents of that directory


The first requirement needs just some permission management. For the second requirement you have two options:

  1. Use a directory outside the webserver DocumentRoot (so the users won't be able to list the directory)
  2. 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.

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)

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.

History

Advanced
Information Version
drsassafras Mass search and replace 17
View
Xavi (as xavidp - admin) 16
View
Philippe Cloutier important changes 15
View
terris 14
View
Philippe Cloutier Changed 1.7.1.1 to 1.7.2 13
View
cbarbry 11
View
Jeremy Butler 9
View
Jeremy Butler 7
View
Jeremy Butler 6
View
Marc Laporte 5
View
Marc Laporte 4
View
Dennis Heltzel 3
View
Scott W Fischer 2
View