Comment 0 for bug 1618897

Revision history for this message
George Shuklin (george-shuklin) wrote :

Following example in the section "Image data" is incorrect:

curl -i -X PUT -H "X-Auth-Token: $token" \
   -H "Content-Type: application/octet-stream" \
   -d @/home/glance/ubuntu-12.10.qcow2 \
   $image_url/v2/images/{image_id}/file

-d option is equal to --data-ascii, which, according to curl man page is:

"When --data is told to read from a file like that, carriage returns and newlines will be stripped out."

This will mange uploaded image.

Proper command line is:

curl -i -X PUT -H "X-Auth-Token: $token" \
   -H "Content-Type: application/octet-stream" \
   -data-binary @/home/glance/ubuntu-12.10.qcow2 \
   $image_url/v2/images/{image_id}/file