Skip to content

Conversation

Meldiron
Copy link
Contributor

🚧 BREAKING CHANGE 🚧

This PR will require new usage.

Before:

storage.createFile( fs.createReadStream("file.png"); )

After:

storage.createFile( "file.png" )

This is required, because we need to create multiple read streams with different start&end pointers in case of chunk upload (over 5MB)

🚧 END BREAKING CHANGE

Snippet:

const sdk = require("meldicektesticek");

const client = new sdk.Client();
let storage = new sdk.Storage(client);

client
 .setEndpoint("http://localhost/v1")
 .setProject("dev")
 .setKey(
  "1174819a7d8c52d16d1eabe45773f5e16b05d7536e8b015b806a9c61e9673eefcb34006be50a8dd70aa96fc73ac1f5f99c7959cd7ccbc1a15aba64f33db7b38db2d914fb84c39a5d3316b8b941ed57d337346e07f0f82c2e0b68270a89bd9e2bbdd18527fce09441ddda283908252959dd5e70bd5185a1646bbce4b3b5274b53"
 );

let promise = storage.createFile(
 "vsetko",
 "unique()",
 __dirname + "/file.mp4",
 undefined,
 undefined,
 (data) => {
  console.log("D", data);
 }
);

promise.then(
 function (response) {
  console.log(response);
 },
 function (error) {
  console.log(error);
 }
);

Output:
CleanShot 2022-01-19 at 13 53 14
CleanShot 2022-01-19 at 13 53 32
CleanShot 2022-01-19 at 13 53 24

@Meldiron Meldiron changed the base branch from master to feat-preps-for-0.13 January 24, 2022 10:41
Copy link
Contributor

@christyjacob4 christyjacob4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments.

Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
@christyjacob4 christyjacob4 merged commit 21c54d0 into feat-preps-for-0.13 Jan 26, 2022
@lohanidamodar lohanidamodar deleted the feat-large-file-web branch June 5, 2022 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants