Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
steevepay committed Jun 30, 2021
1 parent 8ee2a54 commit 310ccdf
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OVH Object Storage High Availability

![Version](https://img.shields.io/badge/version-0.1.0-blue.svg?style=flat-square&cacheSeconds=2592000)
![Version](https://img.shields.io/badge/version-0.1.1-blue.svg?style=flat-square&cacheSeconds=2592000)
[![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg?style=flat-square)](#api-usage)


Expand Down Expand Up @@ -48,14 +48,23 @@ storage.connection((err) => {
```
Upload a file
```js
const path = require(path)
const path = require(path);

/** SOLUTION 1: The file content can be passed by giving the file absolute path **/
storage.writeFile('container', 'filename.jpg', path.join(__dirname, './assets/file.txt'), (err) => {
if (err) {
// handle error
}
// success
});

/** SOLUTION 2: A buffer can be passed for the file content **/
storage.writeFile('container', 'filename.jpg', Buffer.from("File content"), (err) => {
if (err) {
// handle error
}
// success
});
```
Download a file
```js
Expand Down

0 comments on commit 310ccdf

Please sign in to comment.