Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juicy/juicy-filedrop
FileDrop panel
https://github.com/juicy/juicy-filedrop
polymer
Last synced: 11 days ago
JSON representation
FileDrop panel
- Host: GitHub
- URL: https://github.com/juicy/juicy-filedrop
- Owner: Juicy
- License: mit
- Created: 2014-06-05T15:14:08.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-18T13:37:45.000Z (almost 8 years ago)
- Last Synced: 2024-10-11T06:55:11.258Z (about 1 month ago)
- Topics: polymer
- Language: HTML
- Homepage: http://juicy.github.io/juicy-filedrop
- Size: 34.2 KB
- Stars: 6
- Watchers: 10
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# <juicy-filedrop>
> Polymer Element with file drop panel
## Demo
[Check it live!](http://Juicy.github.io/juicy-filedrop)
## Install
Install the component using [Bower](http://bower.io/):
```sh
$ bower install juicy-filedrop --save
```Or [download as ZIP](https://github.com/Juicy/juicy-filedrop/archive/master.zip).
## Usage
1. Import Web Components' polyfill (if needed):
```html
```2. Import Custom Element:
```html
```3. Start using it!
```html
```## Options
Attribute | Options | Default | Description
--- | --- | --- | ---
`url` | *string* | `` | URL to files storage server.
`customheader` | *string* | `x-file` | Name for custom header that contains JSON with file meta data.
`maxfilesize` | *int* | `524288` | Maximum file size in bytes, 512 KiB by default.
`allowedmimetypes` | *string* | `image/gif,image/jpeg,image/png,image/svg+xml` | Allowed mime types.## Events
Event | `event.detail` | Description
--- | --- | ---
`fileUploading` | `{ type: "mime/type", name: "file_name.ext" }` | Triggers when uploading starts.
`fileUploaded` | `{ type: "mime/type", name: "file_name.ext", status: 200, statusText: "OK", url: "location" }` | Triggers when files was successfully uploaded.
`fileUploadError` | `{ type: "mime/type", name: "file_name.ext", status: 500, statusText: "Internal Error", url: "" }` | Triggers when upload fails.
`fileSelectError` | `{ file: { type: "mime/type", name: "file_name.ext" }, message: "file_name.ext has invalid mime type." }` | Triggers when selected file is too big or has not allowed mime type.## Methods
Event | Description
--- | ---
`openFile` | Opens file prompt## [Contributing and Development](CONTRIBUTING.md)
## History
For detailed changelog, check [Releases](https://github.com/Juicy/juicy-filedrop/releases).
## License
MIT