[Openstack] upload file from a specific directory

Pádraig Brady P at draigBrady.com
Wed May 23 00:08:55 UTC 2012


On 05/22/2012 11:43 AM, khabou imen wrote:
> Hi everybody,
> when runnig this  command 
> swift -v -V 2.0 -A http://192.168.1.5:5000/v2.0/  -U service:swift -K swiftpass upload Containera doc1.pdf
> the file  "doc1.pdf" is well uploaded  only if it's placed in the home directory
> How can I upload a file from a different directory
> such as /home/imen/Desktop/img1.jpg?

Referencing arbitrary files works fine here:

$ rpm -qf $(which swift)
openstack-swift-1.4.8-2.el6.noarch

$ swift upload c1 /etc/issue
etc/issue
$ (cd /etc; swift upload c2 resolv.conf)
resolv.conf

$ mkdir t
$ cd t

$ swift download --all
c1/etc/issue
c2/resolv.conf
$ swift download c1
etc/issue
$ swift download c2
resolv.conf

$ find -ls
277027    4 drwxrwxr-x   5 padraig  padraig      4096 May 23 00:29 .
277556    4 drwxrwxr-x   2 padraig  padraig      4096 May 23 00:29 ./etc
277558    4 -rw-rw-r--   1 padraig  padraig        85 Mar  8 12:31 ./etc/issue
277437    4 drwxrwxr-x   2 padraig  padraig      4096 May 23 00:29 ./c2
277438    4 -rw-rw-r--   1 padraig  padraig        55 May 22 13:41 ./c2/resolv.conf
277434    4 drwxrwxr-x   3 padraig  padraig      4096 May 23 00:29 ./c1
277435    4 drwxrwxr-x   2 padraig  padraig      4096 May 23 00:29 ./c1/etc
277436    4 -rw-rw-r--   1 padraig  padraig        85 Mar  8 12:31 ./c1/etc/issue
277646    4 -rw-rw-r--   1 padraig  padraig        55 May 22 13:41 ./resolv.conf

Note the pseudo hierarchical directories are supported through:
http://docs.openstack.org/api/openstack-object-storage/1.0/content/pseudo-hierarchical-folders-directories.html

cheers,
Pádraig.




More information about the Openstack mailing list