Name

file

Type

_input

Synopsis

Using file uploads

Description

Use a form to upload one or multiple files.

Parameters

_input type="file"

target* : Name of the File Upload Wiki Page

pagecontent : Text content to be added on the File Page

force : When an image, force to certain format (png, jpg or gif)

error_id : Id of a DOM Element where error notices will be shown

verbose_id : Id of a DOM element where information about the file is shown

use_label : Doesn't require a value. When an input field has a label attached to it, then the label will become the upload button and the input field will be hidden

dropzone : Doesn't require a value. Will turn the verbose div into an additional file drop zone

parsecontent: Will force FlexForm to first parse the content through the Wiki Parser

*= a required variable

The target is basically the name you want to use to store the file or files. It recognizes [mwrandom], [filename] and other form fields, by using their name with square brackets around them (see example). pagecontent can also hold form variables.


Example

This example accepts only a value between 0 and 10 with steps of 0.01 (e.g. 2.21)

Example 1

  <_input type="file" target="pictures-[filename]-[mwrandom]" pagecontent="Information of the test file" error_id="div-error" verbose_id="div-verbose" />

Uploading files without a name will not work.

Example 2

Always make sure an image will be transformed to jpeg.

Allow for multiple file upload.

Add form text field "description" on the files page content.

  <_form action="addToWiki">
  <_input type="file" multiple="multiple" target="pictures-[filename]-[mwrandom]" pagecontent="Information for this image<br>[description]" force="jpg" />
    <_input type="text" name="description" />
    <_input type="submit" value="upload" />
  </_form>

Note

Links

ws-page-props