Description
Command Detail
POST
HTTP Method
Write
Access Type
Guest, User, Admin
Access Level
Example of issuing the upload CDT file command (assuming the filename is NTRP.cdt):
Input:
curl -k -X POST -H "X-SESSION-ID: $token" -F cdtfile=@"C:/myfiles/NTRP.cdt"
"https://192.168.0.1/cdt_upload.html?cdtfile=NTRP.cdt"
Expected output:
<html><body></body></html>
Chunky CDT Upload Command
Due to memory constraints, in Version 2.75 or later, the traditional single command line curl variant of
the CDT Upload command may fail with some builds. The following describes the support for "ChunkyDL"
which requires the Client software to break up the source file into more manageable chunks, and issue
sequential POST commands to achieve the full CDT File Upload without incurring significant memory
allocation on the target.
Important
Curl command line only supports the
–
F option to send multi-part HTML form body content. The command
line does not have a built-in method of streaming single file content in chunks of data. The
–
F option puts the
entire file into a single buffer, before sending the content out in a single POST operation.
Unlike bash scripting with the Curl command line, client software that uses libcurl native C library, Java,
Python bindings, PHP, or Java Script does not have the limitation or requirement to split the source file
up into many chunks. In these cases, the language support allows using byte array buffers and HTML
header creation methods to format and send the chunked multi-part HTML form POST commands.
Note
In order to overcome the command line limitation, client software which runs from a bash shell may use a
bash shell based script to implement the following algorithm:
•
Source file must be broken up into many files, with a maximum size of 10 MB (10*1024*1024) each.
This requirement may be met by pre-processing the source cdt file with the bash shell split command.
The "split.exe" command is available and installed on Windows client systems, using the default cygwin64
distribution.
•
Each POST operation maintains the same
–
F file command line syntax, with the addition of a new header
that must be patched by the client script for each POST call. This header has three inputs per chunk (for
example, POST command): start offset byte (within the source file), end offset byte (included in the size
of the current chunk), and total source file size (in bytes).
Cisco D9800 Network Transport Receiver Version 2.75 RESTful Web Services API Reference Guide
16
API Definitions
Legacy CDT Upload Command