mpf:upload

 | upload files from client to server |

 | integrated backup and automatic versioning functionality |

 |  |  |
 |
= | [myuploadpath]  | |
absolute path of folder to store files into.
|
|| | mode=[overwrite|protect|backup|version|newversion] | |
the following upload-modes may be set:
overwrite | replace existing files (default) |
protect | do not upload if file exists |
backup | create backup of replaced files (incremental) |
version | replace latest available version |
newversion | create new version if file exists |
|
|| | param=[myparam] | |
set name of file-input field, if you want to upload files from a specific file-input field (and not from all available file-input fields)
|
|| | maxsize=[mysize] | |
you may restrict maximum file size allowed to be uploaded - there is no limitation, if this parameter is not set
|
|| | accept=[allowedTypes] | |
if this parameter is set, then only listet mime-types may be uploaded (e.g. text/plain,text/html,...)
|
|| | folder=[create] | |
use this parameter if folder does not exist on server and if you want it to be created.
|
|| |
convert=[lowercase|uppercase|upperfirst]
|
|
convert file path before condition check
|
|| |
encode=[url|html|html-chars|crypt]
|
|
encode file path to another format before condition check
|
|| |
trim=[left|right|both]
|
|
remove whitespaces from file path before condition check
|
|| |
convert_section=[lowercase|uppercase|upperfirst]
|
|
convert section data (for use with closing token only)
|
|| |
parse_section=[yes|no]
|
|
parse section data for mpf-tokens (for use with closing token only)
|
|| |
encode_section=[url|html|html-chars|crypt]
|
|
encode section data to another format (for use with closing token only)
|
|| |
trim_section=[left|right|both]
|
|
remove whitespaces from section data (for use with closing token only)
|
|| |
[opr][condition]
|
|
condition may be used to check file path/name
|
|  |  |  |  |
accessing attributes of uploaded files
the follwing attributes are available:
filename | filename |
mime | filetype |
display upload errors
the follwing errors may occur:
upload | upload not successful |
exist | file does exist (if "mode=protected" is set) |
size | file size to big (if "maxsize=xxx" is set) |
accept | file type not accepted (if "accept=xxx" is set) |
Errors can be accessed using the following token structure:
{mpf:upload/error/exist/1||!=}
... file {mpf:upload/filename/1} could not be uploaded ...
{mpf:upload/error/exist/1||!=}
{mpf:upload/error/accept/2||!=}
... file {mpf:upload/filename/2} was not accepted ...
{mpf:upload/error/accept/2||!=}
|