Constructor
new Transfer(fileInput, optionsopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
fileInput |
string | File path |
||
options |
Object |
<optional> |
{} |
|
- Version:
- 0.4.0
- Source:
Members
fileInput :string
The input file path/URL
Type:
- string
- Source:
fileSize :number
The size of the file in bytes
Type:
- number
- Source:
options :Object
A got
options object
Type:
- Object
- Source:
- See:
Methods
(protected) _contentType(options, fileopt)
Adds Content-Type header to the request
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
Object | An HTTP options object |
||
file |
string |
<optional> |
null | The input file |
- Since:
- 0.4.0
- Source:
download(destination) → {external:ProgressPromise.<(string|TransferError)>}
Download a file from DOMAIN
Parameters:
Name | Type | Description |
---|---|---|
destination |
string | Destination path |
- Source:
- To Do:
-
- Support decrypting
Returns:
The path if resolved, a TransferError
if rejected
- Type
- external:ProgressPromise.<(string|TransferError)>
upload(filenameopt) → {external:ProgressPromise.<(string|TransferError)>}
Upload a file to DOMAIN
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
filename |
string |
<optional> |
The name of the uploaded file |
- Source:
Returns:
The link if resolved, a TransferError if rejected
- Type
- external:ProgressPromise.<(string|TransferError)>