Coder Social home page Coder Social logo

alexanderwillner / contao-fineuploader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from terminal42/contao-fineuploader

0.0 1.0 0.0 2.63 MB

Uploader extension with chunking support for Contao Open Source CMS using FineUploader by Widen

License: MIT License

JavaScript 15.33% PHP 70.12% CSS 6.05% HTML 8.51%

contao-fineuploader's Introduction

FineUploader Bundle for Contao Open Source CMS

This extension integrates the Fine Uploader by Widen with Contao Open Source CMS.

Installation

Install the package using Composer:

composer require terminal42/contao-fineuploader

Usage

Define the form field as follows:

$GLOBALS['TL_DCA']['tl_table']['fields']['myupload'] = [
    'label'     => &$GLOBALS['TL_LANG']['tl_table']['myupload'],
    'exclude'   => true,
    'inputType' => 'fineUploader',
    'eval'      => [
        'multiple'          => true,                        // Allow multiple files to be uploaded
        'storeFile'         => true,                        // Store the files on the server
        'uploadFolder'      => 'files/uploads',             // Upload target directory (can also be a Contao file system UUID)
        'useHomeDir'        => true,                        // Upload to the current logged in member home directory (overrides "uploadFolder", can also be a Contao file system UUID)
        'uploaderLimit'     => 4,                           // Maximum files that can be uploaded
        'maxConnections'    => 3                            // Maximum allowable concurrent requests
        'addToDbafs'        => true,                        // Add files to the database assisted file system
        'doNotOverwrite'    => true,                        // Do not overwrite files in destination folder
        'debug'             => true                         // Enable the debug mode (always true in development environment)

        // Validation
        'extensions'        => 'pdf,zip',                   // Allowed extension types
        'minlength'         => 1048000,                     // Minimum file size
        'maxlength'         => 2048000,                     // Maximum file size (ignored if you use chunking!)
        'minWidth'          => 400,                         // Minimum image width
        'maxWidth'          => 800,                         // Maximum image width
        'minHeight'         => 300,                         // Minimum image height
        'maxHeight'         => 600,                         // Maximum image height

        // Chunking
        'chunking'          => true,                        // Enable chunking
        'chunkSize'         => 2000000,                     // Chunk size in bytes
        'concurrent'        => true                         // Allow multiple chunks to be uploaded simultaneously per file

        // Rendering
        'imageSize'         => [160, 120, 'center_center'], // Thumbnail image size that is generated upon image upload
        'isGallery'         => true,                        // Display the widget as image gallery
        'isDownloads'       => true,                        // Display the widget as file list
        'sortable'          => true,                        // Make the uploaded files sortable
        'uploadButtonTitle' => 'Upload',                    // Custom upload button title

        // Upload the files directly to the destination folder. If not set, then the files are first uploaded
        // to the temporary folder and moved to the destination folder only when the form is submitted
        'directUpload'      => true,
    ],
    'sql' => "blob NULL"
];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.