Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

In2fileupload

Is a TYPO3 extension that makes it possible to force the user to set metadata such as copyright when uploading.

Requirements

  • TYPO3 ^14.3
  • PHP ^8.2

For TYPO3 11, 12 and 13 use the branches typo3-v11, typo3-v12 and typo3-v13.

Contribution with ddev

This repository provides a DDEV-backed development environment (TYPO3 14.3, PHP 8.2). If DDEV is installed, simply run the following commands to quickly set up a local environment:

  • ddev start
  • ddev initialize

Requirements

  1. Install ddev, see: https://ddev.readthedocs.io/en/stable/#installation

Installation

  1. Clone this repository
  2. Run ddev start
  3. Run ddev initialize to setup configurations and test database
  4. Open the backend at https://in2fileupload.ddev.site/typo3 and log in with admin / password

TypoScript configuration

Allowed file types (settings.allowedFileTypes)

allows you to restrict the files that are uploaded to certain file formats (comma-separated list). Possible are wildcards image/*, or exact mime types image/jpeg, or file extensions .jpg

see: https://uppy.io/docs/uppy/#restrictions

module.tx_in2fileupload.settings.allowedFileTypes = image/*, .pdf

Meta field configuration (settings.fieldConfiguration)

The metadata fields that are displayed during the upload are configured here. In addition, fields can also be defined here as mandatory fields which must then be filled in before the upload. It is also possible to use your own defined fields in "sys_file_metadata" here. As long as these are defined in the TCA.

fieldConfiguration {
    sys_file_metadata {
        title {
            required = 0
            title = LLL:EXT:in2fileupload/Resources/Private/Language/Backend/locallang.xlf:title
        }

        description {
            required = 0
            title = LLL:EXT:in2fileupload/Resources/Private/Language/Backend/locallang.xlf:description
            placeholder = LLL:EXT:in2fileupload/Resources/Private/Language/Backend/locallang.xlf:description.placeholder
        }

        copyright {
            required = 1
            title = LLL:EXT:in2fileupload/Resources/Private/Language/Backend/locallang.xlf:copyright
        }
    }
}

Options:

  • required (0 or 1): defines if the configured meta field is required to be filled before upload
  • title (string or language key): the displayed title of the input field
  • placeholder (string or language key): the displayed placeholder of the input field

Duplication behaviour (settings.duplicationBehaviour)

TYPO3 provides three options for the duplication behaviour. This extension supports all three options.

Options:

rename [default]:

appends a number to the end of the file name. Thus, for example, "myFile.jpg" becomes "myFile_01.jpg" This is the current default bahaviour.

replace:

replaces the already existing file and overrides the potentially already set metadata

cancel:

the upload for this file is canceled

The duplication behaviour can be set via:

module.tx_in2fileupload.settings.duplicationBehaviour = rename

Events

  • ModifyModuleConfigurationEvent
  • ModifyFileMetaInformationEvent
  • AfterUploadValidationEvent

External libraries

Uppy

Uppy is a sleek, modular open source JavaScript file uploader.

Known issues

  • there is currently no simple possible way to theme / style the uppy dashboard.

possible features for the future:

  • categorisation
  • fill fields of other tables
  • more events
  • localization of different backend language as "de" and "en"
  • code cleanup
  • option to set meta information for all uploaded files
  • prefill of meta fields

About

Is a TYPO3 file upload extension that allows the user to force certain metadata such as copyright to be set during the upload

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages