Ask Your Question
0

How to upload a file using PUT with Swift API?

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

KaspNiel gravatar image

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

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 https://xyz.clouddrive.com/v1/my-container/test.xml -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 https://xyz.clouddrive.com/v1/my-container/ -X GET -H "X-Auth-Token: my-token"
edit retag flag offensive close merge delete

Comments

Can you look at the logs on the server side?

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

2 answers

Sort by » oldest newest most voted
3

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

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

smaffulli gravatar image

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

edit flag offensive delete link more
0

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 4,229 times

Last updated: Apr 22 '15