Boffin Codersts-netstorageapi-akamaiby Boffin Coders

Transfer

upload PUT

Upload a local file to Akamai NetStorage.

await ns.uploadAsync("./dist/app.js", "/123456/static/");
// uploaded as /123456/static/app.js

Signatures

uploadAsync(local_source: string, ns_destination: string): Promise<UploadResponse>
upload(local_source: string, ns_destination: string, callback: (err: any, res?: http.IncomingMessage, body?: UploadResponse) => void): void

Parameters

NameTypeDescription
local_sourcestringPath of the local file.
ns_destinationstringNetStorage path. End it with / to keep the local file name.

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)
CLIakamai-netstorage upload ./dist/app.js static/

Build and sign this request in the playground →

Notes

uploadBuffer →