Constructor
new Objects(context)
Object constructor
Parameters:
Name | Type | Description |
---|---|---|
context |
OVHStorage |
OVHObjectStorage context |
- Source:
Methods
(async) copy(pathOrigin, pathToPaste) → {Promise.<Object>}
Copy online file from another destination on account
Parameters:
Name | Type | Description |
---|---|---|
pathOrigin |
String |
Source file path to copy |
pathToPaste |
String |
Destination file path to paste |
- Source:
(async) copy_with_result(pathOrigin, pathToPaste) → {Promise.<Boolean>}
Copy online file from another destination on account and return boolean as result
Parameters:
Name | Type | Description |
---|---|---|
pathOrigin |
String |
Source file path to copy |
pathToPaste |
String |
Destination file path to paste |
- Source:
(async) delete(path, checkContaineropt) → {Promise.<Object>}
Delete file object
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
path |
String |
Path of file with container |
||
checkContainer |
Boolean |
<optional> |
true |
Boolean to disable check existence of container |
- Source:
(async) delete_with_result(path, checkContaineropt) → {Promise.<Boolean>}
Delete file object and return boolean as result
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
path |
String |
Path of file with container |
||
checkContainer |
Boolean |
<optional> |
true |
Boolean to disable check existence of container |
- Source:
(async) deletes(paths, checkContaineropt) → {Promise.<Array.<Objects>>}
Delete multiple files object
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
paths |
Array.<string> |
Array of path file |
||
checkContainer |
Boolean |
<optional> |
true |
Boolean to disable check existence of container |
- Source:
(async) deletes_with_result(paths, checkContaineropt) → {Promise.<Boolean>}
Delete multiple files object and return boolean as result
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
paths |
Array.<string> |
Array of path file |
||
checkContainer |
Boolean |
<optional> |
true |
Boolean to disable check existence of container |
- Source:
(async) download(path, pathLocal) → {Promise.<(Boolean|Error)>}
Download file
Parameters:
Name | Type | Description |
---|---|---|
path |
String |
Online path of file with container |
pathLocal |
String |
Local path to download file |
- Source:
(async) exist(path) → {Promise.<Boolean>}
Check if file object exist
Parameters:
Name | Type | Description |
---|---|---|
path |
String |
Path of file with container |
- Source:
(async) expire_after(path, delete_seconds) → {Promise.<Object>}
Expire file after X seconds
Parameters:
Name | Type | Description |
---|---|---|
path |
String |
Path of file with container |
delete_seconds |
number |
- Source:
(async) expire_after_with_result(path, delete_seconds) → {Promise.<Boolean>}
Expire file after X seconds and return boolean as result
Parameters:
Name | Type | Description |
---|---|---|
path |
String |
Path of file with container |
delete_seconds |
number |
- Source:
(async) expire_at(path, expire_date) → {Promise.<Object>}
Expire file at datetime
Parameters:
Name | Type | Description |
---|---|---|
path |
String |
Path of file with container |
expire_date |
Moment |
- Source:
(async) expire_at_with_result(path, expire_date) → {Promise.<Boolean>}
Expire file at datetime and return boolean as result
Parameters:
Name | Type | Description |
---|---|---|
path |
String |
Path of file with container |
expire_date |
Moment |
- Source:
(async) get(path, encoding) → {Promise.<{content: *, headers: Objects}>}
Get file
Parameters:
Name | Type | Description |
---|---|---|
path |
String |
Path of file with container |
encoding |
String | null | undefined |
If null, the body is returned as a Buffer by default it is utf8. |
- Source:
(async) info(path) → {Promise.<Object>}
Get information details of file object
Parameters:
Name | Type | Description |
---|---|---|
path |
String |
Path of file with container |
- Source:
metas() → {AccountMeta}
Manage meta data of object
Available methods : create(), update(), delete(), all(), has(), get()
- Source:
(async) save(file, path) → {Promise.<Object>}
Parameters:
Name | Type | Description |
---|---|---|
file |
String |
Local file path to save |
path |
String |
Path where to store the file |
- Deprecated:
-
- Use saveFile(file, path) Save file
- Source:
(async) save_with_result(file, path) → {Promise.<Object>}
Save file and return boolean as result
Parameters:
Name | Type | Description |
---|---|---|
file |
String |
Local file path to save |
path |
String |
Path where to store the file |
- Source:
(async) saveData(file, path) → {Promise.<Object>}
Save file data
Parameters:
Name | Type | Description |
---|---|---|
file |
Buffer | Uint8Array | Blob | string | Readable |
data to save |
path |
String |
Path where to store the file |
- Source:
(async) saveFile(file, path) → {Promise.<Object>}
Save file
Parameters:
Name | Type | Description |
---|---|---|
file |
String |
Local file path to save |
path |
String |
Path where to store the file |
- Source:
(async) set(file, path) → {Promise.<Object>}
Set file
Method deprecated prefer save() method
Parameters:
Name | Type | Description |
---|---|---|
file |
String |
Local file path to save |
path |
String |
Path where to store the file |
- Deprecated:
-
- Yes
- Source:
(async) set_with_result(file, path) → {Promise.<Object>}
Set file and return boolean as result
Method deprecated prefer save_with_result() method
Parameters:
Name | Type | Description |
---|---|---|
file |
String |
Local file path to save |
path |
String |
Path where to store the file |
- Deprecated:
-
- Yes
- Source: