Download a File

To download a file, send a GET request to the object.

  1. To send REST API calls to Object Storage Classic, you need a valid authentication token. If you obtained a token less than 30 minutes ago, then you can use that token. Otherwise, get a new token as described in Get an Authentication Token.
  2. Send a GET request to the object. Specify the authentication token in the x-auth-token header.

    Syntax

    curl -X GET \
      {accountRestEndpointURL}/{containerName}/{objectName} \
      -H 'x-auth-token: {authToken}' \
      -o {targetLocalFileName}

    Sample Command

    curl -X GET \
      https://myaccount.ocm.rack01.example.com/v1/Storage-myaccount/mycontainer/myobject \
      -H 'x-auth-token: AUTH_tk10d7cf10041726fa2e64652d975bbab0' \
      -o myfile