Code Monkey home page Code Monkey logo

ezplatform-multi-file-upload's Introduction

ezsystems/ezplatform-multi-file-upload

Allows uploading multiple files as new content items at once.

Install

  1. From your eZ Platform installation, run composer:
$ composer require ezsystems/ezplatform-multi-file-upload
  1. Enable the bundle by adding:
new EzSystems\MultiFileUploadBundle\EzSystemsMultiFileUploadBundle(),

to app/AppKernel.php.

  1. Setup routing by adding bundle configuration to app/config/routing.yml:
 _eZPlatformMultiFileUpload:
     resource: "@EzSystemsMultiFileUploadBundle/Resources/config/routing.yml"
     prefix:   "%ezpublish_rest.path_prefix%"
  1. Clear cache and setup assets with $ composer run-script post-update-cmd

    (if you use prod env make sure that it is set with $ export SYMFONY_ENV=prod first).

Configuration

Example application configuration (app/config/config.yml):

# ...

ez_systems_multi_file_upload:
    location_mappings:
        -   # gallery
            content_type_identifier: gallery
            mime_type_filter:
                - video/*
                - image/*
            mappings:
                -   # images
                    mime_types:
                        - image/jpeg
                        - image/jpg
                        - image/pjpeg
                        - image/pjpg
                        - image/png
                        - image/bmp
                        - image/gif
                        - image/tiff
                        - image/x-icon
                        - image/webp
                    content_type_identifier: image  # content type of new items
                    content_field_identifier: image # field of content type to pass file to  
                    name_field_identifier: name     # field of content type to pass filename to
                -   # videos
                    mime_types:
                        - video/avi
                        - video/mpeg
                        - video/quicktime
                        - video/mp4
                        - video/webm
                        - video/3gpp
                        - video/x-msvideo
                        - video/ogg
                    content_type_identifier: video
                    content_field_identifier: file
                    name_field_identifier: name

    default_mappings:
        -   # file
            mime_types:
                - image/svg+xml
                - application/msword
                - application/vnd.openxmlformats-officedocument.wordprocessingml.document
                - application/vnd.ms-excel
                - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
                - application/vnd.ms-powerpoint
                - application/vnd.openxmlformats-officedocument.presentationml.presentation
                - application/pdf
            content_type_identifier: file
            content_field_identifier: file
            name_field_identifier: name

    fallback_content_type:
        content_type_identifier: file
        content_field_identifier: file
        name_field_identifier: name

Default bundle configuration:

parameters:
    ez_systems.multifile_upload.location_mappings: []

    ez_systems.multifile_upload.default_mappings:
        - # image
          mime_types:
            - image/jpeg
            - image/jpg
            - image/pjpeg
            - image/pjpg
            - image/png
            - image/bmp
            - image/gif
            - image/tiff
            - image/x-icon
            - image/webp
          content_type_identifier: image
          content_field_identifier: image
          name_field_identifier: name
        - # file
          mime_types:
            - image/svg+xml
            - application/msword
            - application/vnd.openxmlformats-officedocument.wordprocessingml.document
            - application/vnd.ms-excel
            - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
            - application/vnd.ms-powerpoint
            - application/vnd.openxmlformats-officedocument.presentationml.presentation
            - application/pdf
          content_type_identifier: file
          content_field_identifier: file
          name_field_identifier: name

    ez_systems.multifile_upload.fallback_content_type:
        content_type_identifier: file
        content_field_identifier: file
        name_field_identifier: name

ezplatform-multi-file-upload's People

Contributors

sunpietro avatar webhdx avatar andrerom avatar emodric avatar

Watchers

James Cloos avatar Dariusz Szut avatar

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.