lue-bird / elm-state-interface / 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.

bytes : { name : String, mimeType : String, content : Bytes } -> Web.Interface future_

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

Replacement for File.Download.bytes