Subir archivos

También disponible en Русский, English, Française, Deutsch



No necesariamente los datos y parámetros requeridos están entre [corchetes].
Utilizar parámetros de acción sin corchetes [ ].

1. Acciones

1.1. 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

Nota: Tenga en cuenta que los archivos pueden ser rechazados en base a otros criterios, por ejemplo, la falta de espacio en disco, porque el archivo es más grande que el tamaño máximo permitido o porque su web-host no permite archivos en particular.


If you’d like to allow larger files, you’ll need to edit the PHP configuration file (php.ini) and add or set the following lines in php.ini (the example allows files up to 32 Mb):

upload_max_filesize = 32M
post_max_size = 32M
max_execution_time = 300

1.2. files


  • muestra los archivos cargados para una página específica o un espacio global
  • Call: {{files [page="PageName" or global=1] [order="time|FILENAME|size|size_desc|ext"] [owner="UserName"] [media=1] [max=Number] [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 (depreciated, see media)
    • media — parses image, audio and video links into their media tags — similar to a gallery
    • nomark — if set to 1, no border around the query result will be shown

2. Syntax of reference to the file

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

2.1. Sintaxis de URL


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

2.2. Sintaxis de Wacko


does search

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

2.2.1. Media Parameters

Los parámetros se añaden a la sintaxis del archivo añadiendo un signo de interrogación ? y añadiendo parámetros adicionales con un ampersand &.
e.g. file:/image.png?200x400&direct&caption


  • linking
    • direct – to file
    • nolink – shows only the image
    • linkonly – shows only link
    • meta – to filemeta handler (default)
  • alignment
    • right
    • left
    • center
  • resizing
    • 400x300 – width x height
    • 0x700 – height
    • 600 – width
  • otros
    • caption – shows caption
    • clear – clears float

Ejemplo:
file:/groups/wackowiki/mammut_800.jpg?500&caption&left

The Woolly Mammoth (Elephas primigenius)
We try to respect the hunter that dominated the first 99.9% of the history of our species. If you had to kill a mammoth or do without supper, there was no time to draw up an organization chart, assign tasks, or delegate authority. Basically, the person who saw the mammoth from farthest away was the Official Sighter, the one who ran fastest was the Head Runner, whoever threw the most accurate spear was the Grand Marksman, and the person all others respected most and listened to was the Chief. That’s all there was to it. Distributing little charts to produce an appearance of order would have been a waste of time. It still is.

3. File storage on server

Archivos para todos los usuarios (global)
file/global/

graphics.png
letter.odt

Archivos de páginas específicas
file/perpage/

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

Archivos después de la copia de seguridad (admin panel)
file/backup/


4. Personalizar la configuración de carga

4.1. Editar constantes: config.php

constants.php


<?php
...
define('UPLOAD_GLOBAL_DIR',                'file/global');
define('UPLOAD_PER_PAGE_DIR',            'file/perpage');
define('UPLOAD_BACKUP_DIR',                'file/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

4.2. Editar configuración secundaria

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|..

attachment settings module