Upload Files

Also available in Русский, Franηaise, Deutsch



Not necessarily required data and parameters are in [square brackets].
Use action parameters without square brackets [ ].

Action

upload


  • Form for file upload to a page or into global space
  • Invoke: {{upload [global=1] [maxsize=200] [hide_description=1]}}
  • Parameters:
    • global — this option allows uploaded files to be globally available for all users
    • maxsize — forcedly limits maximum size (must be less than in config)
    • hide_description — not to show text field "description", there remains only field for the file

files


  • shows uploaded files for a specific page or global space
  • Call: {{files [page="PageName" or global=1] [order="time|FILENAME|size|size_desc|ext"] [owner="UserName"] [picture=1] [nomark=1]}}
  • Parameters:
    • page — define the name of the page, from which the list of files is to be loaded. If global=1, list of global space will be shown
    • order — sort file list by time, name, size, size-in-reverse-order, and file extension
    • owner — show files owned by a specific user
    • picture — pictures will be shown instead of the references — similar to a gallery
    • nomark — if set to 1, no border around the query result will be shown

Syntax of reference to the file

Local uploaded files, per page, were check against the pages read permission.

URL syntax


  • http://example.com/files/global/fubar.zip — the global space
  • http://example.com/Dev/ToDo/Upload/files?get=fubar.zip — the file, attached to the concrete page
    • without rewrite-mode it looks like:
    • http://example.com/?page=Dev/ToDo/Upload/files&get=fubar.zip

Wacko syntax


does search

  1. file:fubar.zip – for in the current local file first then for the global file
  2. file:/fubar.zip – only the global file
  3. file:!/fubar.zip – for local file with relative path
  4. file:/WackoToDo/Upload/fubar.zip – for local file with absolute path, necessary for files in included pages

File storage on server

Files for all users (global)
files/global/

graphic.png
letter.odt

Files of specific pages
files/perpage/

@[page_id]@picture.jpg
@[page_id]@handbook.pdf
@[page_id]@calculation.ods

Files after backup (admin panel)
files/backup/


Customize upload settings

Edit constants: config.php

constants.php


<?php
...
define('UPLOAD_GLOBAL_DIR',                'files/global');
define('UPLOAD_PER_PAGE_DIR',            'files/perpage');
define('UPLOAD_BACKUP_DIR',                'files/backup');
...
?>

  • UPLOAD_GLOBAL_DIR — where are placed the public files
  • UPLOAD_PER_PAGE_DIR — where are placed files only for users allowed to view current page, attached to the concrete pages

Edit secondary config

config setting value description
default_upload_acl Admins who can load. Anonymous authors cannot load ever
upload true who can load. Anonymous authors cannot load ever
upload_images_only true if is established, then it does not give to load something besides pictures. Pictures are determined with the aid of GD
upload_max_size 100 the maximum permissible size of file, in Bytes
upload_quota 0 is how much Byte can be uploaded at all (if it is not established, then as much as desired)
upload_quota_per_user 500000 is how much Byte can be uploaded by one user (if it is not established, then as much as desired)
upload_banned_exts php|cgi|js|php|php3|php4|php5|..