Module

Web.DownloadJs

#download

download :: forall a. Downloadable a => a -> Filename -> MimeType -> Effect Boolean

Sets provided payload to be downloaded by browser, using the particular filename and MIME type.

Example: download "hello world" "hello.txt" "text/plain"

#Downloadable

class Downloadable a  where

A class to represent types which can be downloaded using this library.

You can extend it, adding an instance for your type and casting it to either String (possibly, with data URL), Blob, ArrayBuffer or a typed array. However, you'll have to use unsafeToForeign to finally cast your value. Hope we'll fix that.

Members

Instances

#Filename

#MimeType

Modules