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/");ns.uploadBuffer(manifest, "manifest.json", "/123456/api/manifest.json", (err, res, body) => {
if (!err) console.log(res?.statusCode);
});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
| Name | Type | Description |
|---|---|---|
local_source | Buffer | File contents. |
basename | string | File name used when ns_destination ends with /. |
ns_destination | string | NetStorage path or directory ending with /. |
Returns
UploadResponse
{ message: "Request Processed." }
On the wire
| HTTP method | PUT |
| X-Akamai-ACS-Action | version=1&action=upload |
| Signed with | X-Akamai-ACS-Auth-Data and X-Akamai-ACS-Auth-Sign (HMAC-SHA256) |
| CLI | No CLI equivalent |
Build and sign this request in the playground →
Notes
- Useful for generated files such as JSON feeds or rendered images.