<commit_before># Single Upload
---------------------------------------

[go back to Table of contents][back-to-index]

[back-to-index]: https://github.com/symfony2admingenerator/AdmingeneratorGeneratorBundle/blob/master/Resources/doc/documentation.md#5-form-extensions

### 1. Usage

SingleUpload is a widget for [file](http://symfony.com/doc/current/reference/forms/types/file.html).

#### Features:

* Display file name
* Display file size (browsers with HTML5 File API support only)
* Preview images or show filetype icon instead
* Nameable
* ~~Deletable~~ (not yet implemented)

#### Requirements:

* [VichUploaderBundle](https://github.com/dustin10/VichUploaderBundle)
* (Optional) [AvalancheImagineBundle](https://github.com/avalanche123/AvalancheImagineBundle)

### 2. Support

Upload supports **Doctrine ORM** and *may* support (untested) Doctrine ODM and Propel.

### 3. Configuration

Upload widget configuration:

```yaml
cover:
  label:            Album cover
  formType:         single_upload
  dbType:           string
  addFormOptions:
    nameable:       coverLabel<commit_msg>Update single-upload.md<commit_after># Single Upload
---------------------------------------

[go back to Table of contents][back-to-index]

[back-to-index]: https://github.com/symfony2admingenerator/AdmingeneratorGeneratorBundle/blob/master/Resources/doc/documentation.md#5-form-extensions

### 1. Usage

SingleUpload is a widget for [file](http://symfony.com/doc/current/reference/forms/types/file.html).

#### Features:

* Display file name
* Display file size (browsers with HTML5 File API support only)
* Preview images or show filetype icon instead
* Nameable
* ~~Deletable~~ (not yet implemented)

#### Requirements:

* [VichUploaderBundle](https://github.com/dustin10/VichUploaderBundle)
* (Optional) [AvalancheImagineBundle](https://github.com/avalanche123/AvalancheImagineBundle)

### 2. Support

Upload supports **Doctrine ORM** and *may* support (untested) Doctrine ODM and Propel.

### 3. Configuration

Upload widget configuration:

```yaml
cover:
  label:            Album cover
  formType:         single_upload
  dbType:           string
  addFormOptions:
    nameable:       coverLabel
    data_class:     Symfony\Component\HttpFoundation\File\File
{'fraction_non_alphanumeric': 0.14741035856573706, 'fraction_numerical': 0.009738822487826471, 'mean_word_length': 3.669421487603306, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2358772', 'n_tokens_mistral': 690, 'n_tokens_neox': 663, 'n_words': 162}