Files
Node SDK Media Files
Media is how you can manage assets for an instance. Using media you can upload any type of file to get a globally cached URL for that asset.
All examples assume a properly authenticated SDK instance
Create a file
try { // Use your instances bin ZUID const binZUID = "1-..."; // Get a read stream to the file you want to upload to your instance const stream = fs.createReadStream( path.resolve(__dirname, "path/to/file/image.jpg") ); const opts = { title: "File title used for alt and/or title attribute text", fileName: "image.jpg", }; const file = await sdk.media.createFile(binZUID, stream, opts); console.log(file);} catch (err) { console.log(err);}
Connect with Content Experts
Book a free 15-minute consultation with a content expert. Discuss your application, pain points and requirements. Understand how Zesty's lower total cost of ownership, features, functionality can elevate your business by creating extraordinary digital experiences.
Trusted By
G2 MOMENTUM LEADER

