Boffin Codersts-netstorageapi-akamaiby Boffin Coders

Transfer

uploadBuffer PUT

Upload a Buffer to Akamai NetStorage, for content that never touches the disk.

const manifest = Buffer.from(JSON.stringify({ version: 42 }));
await ns.uploadBufferAsync(manifest, "manifest.json", "/123456/api/");

Signatures

uploadBufferAsync(local_source: Buffer, basename: string, ns_destination: string): Promise<UploadResponse>
uploadBuffer(local_source: Buffer, basename: string, ns_destination: string, callback: (err: any, res?: http.IncomingMessage, body?: UploadResponse) => void): void

Parameters

NameTypeDescription
local_sourceBufferFile contents.
basenamestringFile name used when ns_destination ends with /.
ns_destinationstringNetStorage path or directory ending with /.

Returns

UploadResponse

{ message: "Request Processed." }

On the wire

HTTP methodPUT
X-Akamai-ACS-Actionversion=1&action=upload
Signed withX-Akamai-ACS-Auth-Data and X-Akamai-ACS-Auth-Sign (HMAC-SHA256)
CLINo CLI equivalent

Build and sign this request in the playground →

Notes

← uploaddownload →