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 Da
The official way to do it is now https://package.elm-lang.org/packages/elm/file/latest/
This is an addition that came in Elm 0.19.
Now the official Http package supports it as well. Here is an example from https://package.elm-lang.org/packages/elm/http/latest/Http#request
import File
import Http
type Msg = Uploaded (Result Http.Error ())
upload : File.File -> Cmd Msg
upload file =
Http.request
{ method = "PUT"
, headers = []
, url = "https://example.com/publish"
, body = Http.fileBody file
, expect = Http.expectWhatever Uploaded
, timeout = Nothing
, tracker = Nothing
}