getFile lets you retrieve files uploaded via uploadFile. You can retrieve entire files at a time, or retrieve partial files to stream them for example.
userbase.getFile({
databaseName: 'example-database-name',
fileId: 'example-id'
}).then(({ file }) => {
// file object available
}).catch((e) => console.error(e))
Parameters
-
databaseName [string | Len: 1-100] - The database name to use.
-
fileId [string | Len: 36] - The file's unique identifier.
-
range [object | optional] - The range of bytes to retrieve.
- start [number] - The first byte to retrieve inclusive.
- end [number] - The last byte to retrieve exclusive.
Result
Notes
Advanced Parameters
-
shareToken [string | optional] - The token used to access a shared database.
-
databaseId [string | optional] - The database's unique identifier.
Errors
- ParamsMustBeObject
- DatabaseNotOpen
- DatabaseNameMissing
- DatabaseNameMustBeString
- DatabaseNameCannotBeBlank
- DatabaseNameTooLong
- DatabaseNameRestricted
- DatabaseIdMustBeString
- DatabaseIdCannotBeBlank
- DatabaseIdInvalidLength
- DatabaseIdNotAllowed
- DatabaseIsReadOnly
- FileIdMissing
- FileIdMustBeString
- FileIdCannotBeBlank
- FileIdTooLong
- FileNotFound
- RangeMissingStart
- RangeMissingEnd
- RangeStartMustBeNumber
- RangeEndMustBeNumber
- RangeStartMustBeGreaterThanZero
- RangeEndMustBeGreaterThanRangeStart
- RangeEndMustBeLessThanFileSize
- UserNotSignedIn
- TooManyRequests
- ServiceUnavailable