6.5 HP StoreAll OS User Guide

Example
curl -T temp/a1.jpg https://99.226.50.92/ibrix_share1/lab/images/xyz.jpg
This example uploads the file a1.jpg, stored on the client’s machine in the temp subdirectory of
the user’s current directory, to the HTTP share named ibrix_share1.
The share is accessed by the IP address 99.226.50.92. Because it is accessed using the standard
HTTPS port (443), the port number is not needed in the URL.
The file is created as filename xyz.jpg in the subdirectory lab/images on the share. If the file
already exists at that path in the share, its contents are overwritten by the contents of a1.jpg ,
provided that StoreAll permissions and retention settings on that file and directory allow it. If the
overwriting is denied, an HTTP error is returned.
If the local file does not exist, the response behavior depends on the client tool. In the case of
curl, it returns an error message, such as the following:
curl: can't open '/temp/a1.jpg'
Download a file
This command transfers the contents of a file to the client from the HTTP share. Download capability
already exists in the StoreAll HTTP shares feature, and it is documented here for completeness. If
the file does not exist, a 404 Not Found HTTP error is returned, in addition to HTML output such
as the following:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /api/myfile.txt was not found on this server.</p>
</body></html>
If using curl, the HTML output is saved to the specified local file as if it were the contents of the
file.
The HTTP command is sent in the form of an HTTP GET request.
HTTP syntax
The HTTP request line format is:
GET /<urlpath>/<pathname> HTTP/1.1
The equivalent curl command format entered on one line is:
curl -o <local_pathname>
http[s]://<IP_address>:<port>/<urlpath>/<pathname>
See “Using HTTP” (page 174) for information about the IP address, port, and URL path.
DescriptionParameter
The pathname of the file to be downloaded from the HTTP share and stored on the client’s
system.
local_pathname
The pathname of the existing file on the HTTP share to download to the client.pathname
Example
curl -o temp/a1.jpg http://99.226.50.92/ibrix_share1/lab/images/xyz.jpg
222 HTTP-REST API file-compatible mode shares