A remoteStorage data module for sharing of files.
All shares are stored with a timestamp prefix. For images, thumbnails are created and stored in a subdirectory.
- shares
- storeFile(mimeType, name, data) ⇒
Promise
⏏ - remove(name) ⇒
Promise
⏏ - list() ⇒
Promise
⏏ - getFileURL(name) ⇒
string
⏏
- storeFile(mimeType, name, data) ⇒
Stores a shared file
Kind: Exported function
Returns: Promise
- A promise, which will be fulfilled with the absolute
URL of the newly uploaded file (see )
Access: public
Param | Type | Description |
---|---|---|
mimeType | string |
Content type of the file |
name | string |
Filename |
data | ArrayBuffer |
File contents |
Example
remoteStorage.shares.storeFile(mimeType, filename, content)
.then((url) => { console.log(`successfully stored file at ${url}`)
Remove a file
Kind: Exported function
Access: public
Param | Type | Description |
---|---|---|
name | string |
The filename |
List all shared files
Kind: Exported function
Returns: Promise
- Resolves with an array containing the filenames
Access: public
Get the absolute URL of a file.
Kind: Exported function
Returns: string
- The absolute URL of the file
Access: public
Param | Type | Description |
---|---|---|
name | string |
the filename |