Skip to content

Conversation

Meldiron
Copy link
Contributor

Snippet:

import * as sdk from "/Users/meldiron/Documents/GitHub/sdk-generator/examples/deno/mod.ts";

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

try {
    client
        .setEndpoint('http://localhost/v1') // Your API Endpoint
        .setProject('dev') // Your project ID
        .setKey('...') // Your secret API key
    ;

    const f = await storage.createFile('b', 'unique()', "dirik/big.mp4", [], [], (n) => {
        console.log("N", n);
    });
    console.log(f);
} catch(err) {
    console.error(err);
}

Output:
CleanShot 2022-01-24 at 14 01 00
CleanShot 2022-01-24 at 14 01 11
CleanShot 2022-01-24 at 14 01 15

@Meldiron Meldiron changed the title Feat large file deno Implemented deno chunk upload Jan 25, 2022
Copy link
Member

@lohanidamodar lohanidamodar left a comment

Choose a reason for hiding this comment

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

few concerns, not sure why kotlin change are here?

@lohanidamodar
Copy link
Member

lohanidamodar commented Jan 31, 2022

@Meldiron please revert the change in the kotlin files and I can merge this PR 🙏🏻


// 16kB chunks block limit: https://github.com/denoland/deno/discussions/9906
for (let blockIndex = 0; blockIndex < 320; blockIndex++) {
const buf = new Uint8Array(16384);
Copy link
Contributor

Choose a reason for hiding this comment

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

lets make 16384 a const with the comment regarding the reference to why it is used 👍🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Stored the value in a const variable on Client, and started using it across the chunking system

@lohanidamodar
Copy link
Member

@Meldiron Please check and undo the kotlin changes that are still there, I believe the reverted changes are now shown as change after you synced with 0.13 branch. Check and revert accordingly 🙏🏻

@lohanidamodar lohanidamodar merged commit 67de35a into feat-preps-for-0.13 Feb 1, 2022
@lohanidamodar lohanidamodar deleted the feat-large-file-deno branch February 1, 2022 11:01
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.

3 participants