https://github.com/norpan/elm-file-reader
File Reader api for Elm: http://package.elm-lang.org/packages/norpan/elm-file-reader/latest
https://github.com/norpan/elm-file-reader
Last synced: 5 months ago
JSON representation
File Reader api for Elm: http://package.elm-lang.org/packages/norpan/elm-file-reader/latest
- Host: GitHub
- URL: https://github.com/norpan/elm-file-reader
- Owner: norpan
- Created: 2018-03-18T19:55:33.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-23T10:59:55.000Z (about 7 years ago)
- Last Synced: 2024-10-01T09:19:42.118Z (8 months ago)
- Language: Elm
- Homepage:
- Size: 8.79 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Elm file reader
WARNING: this package won't work in the upcoming Elm 0.19 and there probably
will be no way to publish a package with this API, since it relies on event
handler content attributes, which will be disallowed in the upcoming release.But it will work with Elm 0.18.
This package is a simple way to use the FileReader api from Elm.
It provides attributes that help handle the different events and read files
and send them as messages to Elm.To make a file input and get a message in Elm, this is all you have to do:
```Elm
import FileReadertype Msg =
FileSelected FileReader.FileHtml.input (FileReader.fileInput FileReader.DataURL FileSelected) []
```## Example
Look in the examples folder. Live version at https://norpan.github.io/elm-file-reader-example.html