Parameters

A Blob pointing to the file you'd like to get information from. If you have a DOM File object or raw data, you can use the filepicker.store call to first generate a Blob

options

An optional dictionary of key-value pairs that specify what metadata you want back. By default, we return any metadata we get without having to run over the contents of the file (currently: size, mimetype, filename, uploaded, writeable, location, path, container).

size

Boolean

size: true

Specify that you want the size of the file returned as a number in bytes.

mimetype

Boolean

mimetype: true

Specify that you want the mimetype of the file returned as a string.

filename

Boolean

filename: true

Specify that you want the name of the file returned as a string.

width

Boolean

width: true

Specify that you want the width of the image returned as an integer in pixels. If the file is not an image, width is set to null.

height

Boolean

height: true

Specify that you want the height of the image returned as an integer in pixels. If the file is not an image, height is set to null.

uploaded

Boolean

uploaded: true

Specify that you want the timestamp of when the file was uploaded to Filestack, as a javascript Date object

writeable

Boolean

writeable: true

Specify that you want to know whether the file is writeable. The value will be true or false.

cloud

Boolean

cloud: true

Applies to files uploaded from cloud drives using filepicker.pick only. Specifies that you want to see what metadata is available about the file where it is stored, such as original creation date and caption (if the file was picked from Instagram or Facebook).

source url

Boolean

source_url: true

If your file was selected via the image search or URL search service in the picker using filepicker.pick() and the image was not cropped via the crop interface, then you can request the original url of the file.

Hashing Algorithms

Note:You can specify more than one algorithm in your code, but We will return only one hash based on the lexicographical order of the hashing algorithm names. So for instance, if you specify sha-256 and md5 in the same request, we will compute and return only the MD5 hash.

MD5 Hash

Boolean

md5: true

Specify that you want the md5 hash of the file returned as a string.

SHA-1 Hash

Boolean

sha1: true

Specify that you want the SHA-1 hash of the file returned as a string.

SHA-224 Hash

Boolean

sha224: true

Specify that you want the SHA-224 hash of the file returned as a string

SHA-256 Hash

Boolean

sha256: true

Specify that you want the SHA-256 hash of the file returned as a string

SHA-384 Hash

Boolean

sha384: true

Specify that you want the SHA-384 hash of the file returned as a string

SHA-512 Hash

Boolean

sha512: true

Specify that you want the SHA-512 hash of the file returned as a string

Storage and Security

Storage Location

Boolean

location: true

Specify that you want to know the storage location (S3, etc.) of a stored file, if available, as a string

Storage Path

Boolean

path: true

Specify that you want to know the storage path of a stored file, if available, as a string.

Storage Container

Boolean

container: true

Specify that you want to know the storage container of a stored file, if available, as a string

If you would like to view the exif metadata of a photo as a JSON object, the request must be accompanied by a valid security policy and signature. Without the policy and signature, the EXIF data will not be returned. This is required because EXIF metadata can include personally identifiable information.

onSuccess

The function to call with the requested metadata of the inputted file.

We return a JSON object containing the requested metadata

Sample response

{"width":180,"height":180}

onError

The function to call if there is an error when reading the metadata of the file.