Mezeo Ready Developer Center
May 17, 2012, 06:43:12 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
Author Topic: POST filename and location  (Read 319 times)
Mark Aldred
Newbie
*
Posts: 16


View Profile
« on: July 07, 2010, 09:19:53 AM »

Below is a segment of the Developer Guide - "File Upload Operation" section.  A successful POST returns a Location header with the URI I can use to access the created file.  What purpose does "filename=testfile.txt" serve?  Is this just a way of applying a pretty name to the created file for user control panel viewing?  I know that the "file=@testfile.txt" is required but must I specify the filename argument?


Required form elements: 
o filename ‐ name of the file to create
o form‐data ‐ binary file contents
   Example curl command:
   curl -u $cred -F “file=@testfile.txt;filename=testfile.txt” \
   -H ‘X-Client-Specification: 2’ –H ‘X-Cloud-Key: $Key’
   https://api.example.com/v2/containers/9EC89EB0/contents

   HTTP/1.1 201 Created
   Content-Type: text/uri-list
   https://api.example.com/v2/files/CE0D4812
Logged
Travis McLane
Mezeo Employee
Newbie
*****
Posts: 21



View Profile
« Reply #1 on: July 08, 2010, 01:03:04 PM »

A file created in the system is required to have a filename metadata at this time.

Would you mind providing a use case for this scenario?
I would like to have a bit more information on how it would be used in order to create an enhancement request for this feature.

Note that files without names would be inaccessible using path based apis.
One such api is WebDAV which is currently supported.

As a workaround you could set programmatically generated names that would not otherwise be used to work around this requirement.

Logged
Mark Aldred
Newbie
*
Posts: 16


View Profile
« Reply #2 on: July 08, 2010, 01:19:15 PM »

My application does not use path based APIs.  Path based APIs may be useful for ancillary applications but are not required for my primary application.  We rely strictly on the URI.  Currently I do work around this by generating a random string for the filename metadata.  What would be useful to me would be for you to automatically set the filename metadata to be the same as the location URI which is returned in the POST.  Then I could access the file with a single unique identifier using either method.
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