Members
supportsStreaming
Whether this adapter supports receiving Readable streams in createFile(). If false (default), streams are buffered to a Buffer before being passed. Override and return true to receive Readable streams directly.
Methods
createFile(filename, data, contentType, options) → {Promise}
Responsible for storing the file in order to be retrieved later by its filename
| Name | Type | Description |
|---|---|---|
filename | string | the filename to save |
data | Buffer | | the file data as a Buffer, or a Readable stream if the adapter supports streaming (see supportsStreaming) |
contentType | string | the supposed contentType |
options | object | (Optional) options to be passed to file adapter (S3 File Adapter Only)
|
a promise that should fail if the storage didn't succeed
- Type:
- Promise
deleteFile(filename) → {Promise}
Responsible for deleting the specified file
| Name | Type | Description |
|---|---|---|
filename | string | the filename to delete |
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
| Name | Type | Description |
|---|---|---|
filename | string | the name of file to retrieve |
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
| Name | Type | Description |
|---|---|---|
config | Config | server configuration |
filename | string |
Absolute URL
- Type:
- string |
Promise.<string>
