Ask Your Question

How to upload a file using PUT with Swift API?

asked 2015-04-21 08:01:34 -0600

KaspNiel gravatar image

updated 2015-04-21 10:24:30 -0600

smaffulli gravatar image

I'm trying to upload a simple test.xml file via Swift API. This is my current code which times out:

 curl -i -X PUT -H "X-Auth-Token: my-token"

But the client times out and actually I don't know how to refer to the actual file text.xml which should be uploaded?

Running the GET command works find:

 curl -i -X GET -H "X-Auth-Token: my-token"
edit retag flag offensive close merge delete


Can you look at the logs on the server side?

smaffulli gravatar imagesmaffulli ( 2015-04-21 10:30:17 -0600 )edit

2 answers

Sort by » oldest newest most voted

answered 2015-04-21 13:09:55 -0600

updated 2015-04-21 14:04:20 -0600

smaffulli gravatar image

From the API Docs the URI should be: /v1/​{account}​/​{container}​/​{object}​

edit flag offensive delete link more

answered 2015-04-22 11:10:26 -0600

zaitcev gravatar image

Your curl is waiting for the standard input. You need to supply the file you're uploading with -T.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-04-21 08:01:34 -0600

Seen: 4,955 times

Last updated: Apr 22 '15