# What this PR introduces
This PR introduces a `filepicker` field which is a replacement for the `pagemediaselect` field.
This field loads the files list via AJAX each time it's triggered. This means you can now upload a file via FTP or via Admin and the new file is immediately available to be selected.
Previously, `pagemediaselect` required a page reload to see the newly added files.
--
### Options
#### `accept`
`accept` allows file extensions. For example, to only allow `yaml` and `json` files:
```yaml
accept:
- .yaml
- .json
```
By default, any file is listed.
#### `folder`
```yaml
folder: 'user/plugins/testing`
```
folder has been enhanced to allow `self@` as well as `page@:` and `theme@:` prefixes.
Example of usage, assuming we have a blog item at the route `/blog/ajax-upload` (physical location being `user/pages/02.blog/ajax-upload`), with the `page@:` prefix the folder would be:
```yaml
folder: 'page@:/blog/ajax-upload'
```
#### `preview_images`
```yaml
preview_images: true
```
If enabled, shows a preview for the images file types
> ### NOTE: `self@` is not allowed outside of the Pages scope, an error will be thrown.
## Example usage
```
header.a_file:
type: filepicker
folder: 'user/plugins/admin'
label: Select a file
```
* Reworked the `file` field. All files get uploaded via Ajax and are stored upon Save
This improves the Save task tremendously as now there is no longer the need of waiting for the files to finish uploading. Fully backward compatible, `file` field now includes also a `limit` and `filesize` option in the blueprints. The former determines how many files are allowed to be uploaded when in combination with `multiple: true` (default: 10), the latter determines the file size limit (in MB) allowed for each file (default: 5MB)
* Added support for `accept: [‘*’]` to allow any file type
* Minor tweaks in the comments and messages
* Delete any orphan file when discarding the uploaded files session
* Minor optimization
* Fixed issue with `_json` elements where nested fields merging would get stored in an unexpected way
* Potential fix for wrong order of value in Datetime
* Fixed nested fields for files
* Fixed tmp streams
* Minor cleanup
* Update JSON data when removing a file. Implemented task to remove files that haven’t been saved yet, from the flash object session
* Ensure temporary files are deleted when removing un-saved files from the flash object session
* Fixed wrong reference of HTML file field when clicking on the drop zone area to pick a file
* Added JSON template for pages
* fix a CSS issue in page order
* More CSS fixes
* Trigger file field mutation when adding or removing a file
* Recompiled JS
* Removed twig templates that are no longer needed
* Fixed issue with nested header fields in a page, not properly merging data
* [internal] Fixed issue with collections not capable of handling both param and dot notations at the same time
* Reorganized FileField structure to be more consistent with the other fields
* Added support for dynamically created file fields (ie, autoinitialization on new lists items)
* Added translationable strings for file uploads errors
* Added translasions for all Dropzone available strings
* Changed default values
Adds a new notifications feature to the Admin plugin. It will now lookup notifications which are set up on getgrav.org and will inform users, and also alert for new updates and provide awareness on various topics.
Also fixes issue with Array field in `value_only` mode, improperly displaying the key when novalue was set, and fixes issue with drag handlers in Array not showing/hiding properly (#950)
Updated FontAwesome to 4.6.3
Does not change the page title, just the page route property if set in the header, to avoid two pages with the same slug / route / raw route. Handles ordering too, and pages with custom slug. Independently updates the slug and the folder name.
* various improvements.. needs cleanup
* more progress - supports deeply nested + pages
* Getting close now!
* more progress!
* some cleanup
* use data[_json] to store page-based upload
* Smarter logic to get nested form fields
* some refactoring/cleanup
* Fixed issue with removing multiple files in pages
* Refactor and support `destination: page@:/images` and `destination: self@` syntax for file fields
* Prettifying the upload field
* Handling Files API to better represent the selected files in the input field
* Better plurarl string
* Fixed harcoded height for input field
* revamped CSS!!!
* `fancy: false` turns off fancy styling
* Create folder if not exists
* Add support for @theme/theme@ destination
* Fixed create directory functionality to take into account resolved paths
* Don't allow @self on page to be uploaded to if not created
* added field languages
* css tweaks
* language integration
* refactor
* Added support for multiple files
* fixed appearance a bit
* Always store files as full path => obj data
* added some error handling
* Do not go nested when storing file
* Refactored to not need blueprint set in blueprint
BC issue: if using Admin `develop/ 1.1` with Form != latest develop,
the Admin-side registration form (the one that pops up when Admin is
installed but no accounts are found) will not work. Not something users
would stumble upon: only appears when Admin 1.1 it'll be possible to
use config-title@: theme.antimatter.some_config to set the title
dynamically based on a theme config option is installed but it's not
yet configured, and Form is not up to date. When 1.1 will be released,
also the Form plugin will have a newer update that will be installed
automatically.