Shares

Maintainer:Sebastian Kippe seba.nosp@m.stian@kip.nosp@m..pe
Version:0.3.0

Manages sharing of files.  All shares are stored with a timestamp prefix.  For images, thumbnails are created and stored in a subdirectory.

Summary
Shares
Functions
storeFileStores a shared file
removeRemove a file
listFilesList all shared files
getFileURLGet the absolute URL of a file.
_formattedDateHelper method for formatting dates for filenames

Functions

storeFile

storeFile: function(mimeType,
name,
data)

Stores a shared file

Parameters

mimeTypethe picture MIME type.
namethe picture name.
datathe picture (expected as an `ArrayBuffer`).

Returns

A promise, which will be fulfilled with the absolute URL of the newly uploaded file (see getFileURL).

remove

remove: function(name)

Remove a file

Parameters

namethe filename.

listFiles

List all shared files

Returns

An array containing the filenames.

getFileURL

getFileURL: function(name)

Get the absolute URL of a file.

Parameters

namethe filename.

Returns

The absolute URL of the file.

_formattedDate

_formattedDate: function (date)

Helper method for formatting dates for filenames

Parameters

datea Date object

Returns

A formatted date string, like e.g.  ‘131106-1523’

storeFile: function(mimeType,
name,
data)
Stores a shared file
remove: function(name)
Remove a file
getFileURL: function(name)
Get the absolute URL of a file.
_formattedDate: function (date)
Helper method for formatting dates for filenames
Close