Mezeo Ready Developer Center
February 04, 2012, 06:38:17 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
Author Topic: EXAMPLE [Python] Easy uploading of multiple files with one request  (Read 356 times)
gtillman
Mezeo Employee
Newbie
*****
Posts: 3


View Profile
« on: June 10, 2010, 05:34:43 PM »

Here is a short Python script that shows how to upload multiple files using a single multipart form post.  Full instructions are contained in the attached file.  Run it with a -h option to have it display a help message.  This script uses the poster module (http://pypi.python.org/pypi/poster/0.4) which can be installed with sudo easy_install poster.

Logged
jwhite
Mezeo Employee
Newbie
*****
Posts: 1


View Profile
« Reply #1 on: June 10, 2010, 07:28:49 PM »

Of course once those files are uploaded, you'll need to be able to list them.  While

Prompt> curl -U user:pwd https://site.com/v2/containers/<oid>

works just fine, you can get a lot more information by adding a depth header.

Prompt> curl -U user:pwd https://site.com/v2/containers/<oid> -H "X-Cloud-Depth: 2"

will include a lot more information in the response.  The depth can be from 0 to large, but a value of 2 or 3 usually gets the information I'm looking for (permissions, names, etc).

But be aware that the larger the value, the longer it takes to get a response.
Logged
Pages: [1]
 
Jump to:  

© Mezeo Software. All rights reserved. | Privacy Policies | Contact Us | Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC