Methods
createFile(filename, data, contentType, options) → {Promise}
Responsible for storing the file in order to be retrieved later by its filename
Parameters:
Name | Type | Description |
---|---|---|
filename | string | the filename to save |
data | * | the buffer of data from the file |
contentType | string | the supposed contentType |
options | object | (Optional) options to be passed to file adapter (S3 File Adapter Only)
|
Returns:
a promise that should fail if the storage didn't succeed
- Type:
- Promise
deleteFile(filename) → {Promise}
Responsible for deleting the specified file
Parameters:
Name | Type | Description |
---|---|---|
filename | string | the filename to delete |
Returns:
a promise that should fail if the deletion didn't succeed
- Type:
- Promise
getFileData(filename) → {Promise}
Responsible for retrieving the data of the specified file
Parameters:
Name | Type | Description |
---|---|---|
filename | string | the name of file to retrieve |
Returns:
a promise that should pass with the file data or fail on error
- Type:
- Promise
getFileLocation(config, filename) → {string|Promise.<string>}
Returns an absolute URL where the file can be accessed
Parameters:
Name | Type | Description |
---|---|---|
config | Config | server configuration |
filename | string |
Returns:
Absolute URL
- Type:
- string |
Promise.<string>