File Upload Settings

Settings to handle file uploads.

TypoScript Path

plugin.tx_formhandler_form.settings.predefinedForms.[x].fileUpload

Example Code:

plugin.tx_formhandler_form.settings.predefinedForms.devExample {
  fileUpload {
    nameCleanUp {
      search = /[^A-Za-z0-9_.-]/
      separator =
      replace =
      usePregReplace = true
    }
    removal {
      active = true
      text = X
    }
    total {
      countMax =
      sizeMax =
    }
    withSameName = ignore
  }
}

Properties

nameCleanUp.search

Separated list of characters or regex to replace in file names of uploaded files.

Mandatory

False

Data Type

String

Default

Space character and %20

nameCleanUp.separator

Custom separator for several search patterns.

Mandatory

False

Data Type

String

Default

,

nameCleanUp.replace

Separated list of characters to use as a replacement for the characters or regex configured in nameCleanUp.search.

Mandatory

False

Data Type

String

Default

_

nameCleanUp.usePregReplace

If True, uses preg_replace to search and replace string in a filename in favor of a simple str_replace.

Mandatory

False

Data Type

Boolean

Default

False

removal.active

If True, enables file removal without using an AjaxHandler.
This will just display an “X” or anything entered in removal.text next to a file name of an uploaded file, so the user can remove it.

Mandatory

False

Data Type

Boolean

Default

False

removal.text

Enter a custom text shown as the text of the remove link. Used in combination with removal.active.

Mandatory

False

Data Type

String

Default

X

total.countMax

The total amount of files allowed for upload.

Mandatory

False

Data Type

False|Integer

Default

False

total.sizeMax

The size of all uploaded file allowed for upload. (in Byte)

Mandatory

False

Data Type

False|Integer

Default

False

withSameName

Specify how to deal with files with the same name being uploaded.

The possible values are:
ignore => Files with the same name are ignored.
replace => Files with the same name replace the existing ones.
append => Files with the same name are appended to the list of uploaded files.

Mandatory

False

Data Type

String

Default

ignore