Below is a segment of the
Developer Guide - "File Upload Operation" section. A successful POST returns a Location header with the URI I can use to access the created file. What purpose does "filename=testfile.txt" serve? Is this just a way of applying a pretty name to the created file for user control panel viewing? I know that the "file=@testfile.txt" is required but must I specify the filename argument?
Required form elements:
o filename ‐ name of the file to create
o form‐data ‐ binary file contents
Example curl command:
curl -u $cred -F “file=@testfile.txt;
filename=testfile.txt” \
-H ‘X-Client-Specification: 2’ –H ‘X-Cloud-Key: $Key’
https://api.example.com/v2/containers/9EC89EB0/contents HTTP/1.1 201 Created
Content-Type: text/uri-list
https://api.example.com/v2/files/CE0D4812