Search code examples
elm

File Upload in Elm


How does one upload a file (image or excel) in Elm?

Can't seem to find any examples.

The answer is fine even if the native code is used. Have seen Data in Elm-Html but it appears files and blobs are not supported. What is the way around this?


Solution

  • I am the author of the library MisterMetaphor refers to. It's easier to use than he explains though. Take a look at how I set up elm-package.json in the example: https://github.com/simonh1000/file-reader/blob/master/example/elm-package.json - just add "native-modules": true,.

    I have written a blog to support the release of the code for 0.18 and show how uploads to e.g. S3 can be done in Elm.