Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/psi-4ward/uploadwidget

Contao-Extension: UploadWidget
https://github.com/psi-4ward/uploadwidget

Last synced: 22 days ago
JSON representation

Contao-Extension: UploadWidget

Awesome Lists containing this project

README

        

UploadWidget
======================
**Contao 3 Widget for easy uplading files with drag&drop support**

Features
----------------------
* Independent Widget, no need to use the fileTree or the database driven filesystem.
* Upload via drag&drop if the browser supports
* Use the ID of the current element in the path
* Images displayed as thumbnails
* Uploaded file gets stored not before the user presses the `save` or `save and close` button

**Planed features**

* upload of multiple files
* sync with DB-FS
* cascade deleting of files when the related database-row gets deleted

Installation and Usage
--------------------
Just copy all files in `system/modules/UploadWidget`

**DCA-Field example**
```php
'myImage' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_table']['myImage'],
'exclude' => true,
'inputType' => 'UploadWidget',
'eval' => array
(
'path' => 'files/customImages/{{id}}/myImage',
'extensions' => 'png,jpg,gif',
'overwrite' => false,
'mandatory' => true
),
'sql' => "varchar(255) NOT NULL default ''"
),
```

### Supported eval-parameters


path
The path to store the files. Use {{id}} to reference the ID of the current record.


extensions
Comma sperated list of valid file-extensions


overwrite
boolean, default: false. Set to true to overwrite existing files with the same name


md5AsFilename
boolean, default: false. Set to true to rename the file to its md5 hash


exactSize
array(intWidth, intHeight). Validates the image for the exact size.

Credits, Licence
----------------------

* Uses [Valums Fineuploader](https://github.com/valums/file-uploader).
* Licence: LGPL
* by [4ward.media](http://www.4wardmedia.de)