lue-bird/elm-state-interface/1.0.0

NOTE: the latest version is 2.0.4

Web.FileDownload

Helpers for downloading a dynamically generated file as part of an Interface.

Security note: Browsers require downloads to be initiated by a user event. So rather than allowing malicious sites to put files on your computer however they please, the user has to at least click a button first. As a result, the following interfaces only work when they are triggered by some user event.

Note: There's no equivalent module for file select since you can easily replicate the behavior using an input element with type file or file drop area modifiers, see for example mpizenberg/elm-file.

{ name : String
, mimeType : String
, content : Bytes
}
-> Interface state_

An Interface for downloading a given file with a list of Bits as its content, a given type and and a given default name.

Replacement for File.Download.bytes