package brr

  1. Overview
  2. Docs
On This Page
  1. Files
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Brr.FileSource

File objects and reads.

There are various ways to get File.t values. On of them is to create an El.input element of type file and use the El.Input.files function. Another way is to use drag and drop events and get them via the Ev.Data_transfer values.

Files

Sourcetype init

The type for file initialisation objects.

Sourceval init : ?blob_init:Blob.init -> ?last_modified_ms:int -> unit -> init

init () is a file initialisation object with the given properties.

Sourcetype t

The type for File objects.

Sourceval of_blob : ?init:init -> Jstr.t -> Blob.t -> t

of_blob name b is a file named name with data b.

Note. Reading the constructor specificaton it seems this will not look into b to define the Blob.type' of the resulting file object's blob. You should define it via the init object.

Sourceval name : t -> Jstr.t

name f is the filename of f.

Sourceval relative_path : t -> Jstr.t

relative_path is the webkitRelativePath of f.

Sourceval last_modified_ms : t -> int

last_modified_ms f is the last modified time in milliseconds since the POSIX epoch.

Sourceval as_blob : t -> Blob.t

as_blob f is f's Blob interface.

OCaml

Innovation. Community. Security.