Options

new API release - March 31st, 2005

2»

Comments

  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited April 11, 2005
    No need to get defensive..
    jef wrote:
    Ok, while I was waiting for you to fix the bugs in uploading via XML-RPC
    There is nothing to fix, except your own code.

    I understand the feeling of frustration when the darn thing does not work (and some things in API still do not..), but in this case it's not SM problem.
    Upload was working fine for the last few months, several of us 3d party guys used it successfully in a variety of tools: python, .NET, apple, win32, etc.

    Here, I made an exta run of S*E to give you a working url and sample reply:

    [PHP]
    Multipart post to:

    https://upload.smugmug.com/photos/xmladd.mg
    Response:

    <?xml version='1.0' encoding="iso-8859-1" ?>
    <methodResponse>
    <params>
    <param>
    <value>
    <int>album id here</int>
    </value>
    </param>
    </params>
    </methodResponse>

    [/PHP]

    I used hhtps, but it works with http, too.

    HTH

    PS
    Read *all* the docs, man:-)
    "May the f/stop be with you!"
  • Options
    jefjef Registered Users Posts: 42 Big grins
    edited April 11, 2005
    I have read all the docs. As far as I can tell my code corresponds to them. You mentioned you saw a mismatch - what were you referring to? Please be specific.
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited April 11, 2005
    Well, if you wish so
    jef wrote:
    I don't know what you mean about mismatching. As far as I can tell I am following the current docs.
    Here it is
    :
    "http://upload.smugmug.com/hack/xmlrpc/ smugmug.images.upload"
    You're using old url with a new method.
    No wonder you get "method not found"..

    And by the way, this is all for base64 encoded upload, which is like 30% slower than its multipart POST based twin. Nobody's using it for months, AFAIK..
    So unless you're pursuing purely academic goals I'd suggest you use upload via post, for which I already gave you an example...

    HTH
    "May the f/stop be with you!"
  • Options
    jefjef Registered Users Posts: 42 Big grins
    edited April 11, 2005
    That is the URL specified on this page: http://www.smugmug.com/hack/xmlrpc-overview

    My old-API code, still working as of this morning, used "http://upload.smugmug.com/xmlrpc/&quot; Should I ignore the above doc page and go back to that?

    I know that base64 encoding uses 33% more bytes. Since my network connection is fast, this is not significant. Especially compared to the many seconds of processing time once the image gets to smugmug. In any event, as I said, uploading via XML-RPC using the old API and old URLs was still working as of this morning.
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited April 11, 2005
    Upload
    jef wrote:
    That is the URL specified on this page: http://www.smugmug.com/hack/xmlrpc-overview

    My old-API code, still working as of this morning, used "http://upload.smugmug.com/xmlrpc/&quot; Should I ignore the above doc page and go back to that?

    I know that base64 encoding uses 33% more bytes. Since my network connection is fast, this is not significant. Especially compared to the many seconds of processing time once the image gets to smugmug. In any event, as I said, uploading via XML-RPC using the old API and old URLs was still working as of this morning.
    As I mentioned before, to the best of my knowledge nobody's using "upload" (since for the most of us speed still does matter - try upload 10Gb in one shot, and watch those 30% turning into hours:-), so there is a chance that this particular method actually felt through the cracks, and you're the first one to notice...

    It will be up to Don then..

    Good luck!
    "May the f/stop be with you!"
  • Options
    jefjef Registered Users Posts: 42 Big grins
    edited April 11, 2005
    So you have no comment on the doc page that gives the URL I am using?
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited April 11, 2005
    Nope...
    jef wrote:
    So you have no comment on the doc page that gives the URL I am using?
    I stopped using base64 upload method in January, never touched it since.. I was much more concerned over other APIs that did not work at the time..
    "May the f/stop be with you!"
  • Options
    jefjef Registered Users Posts: 42 Big grins
    edited April 11, 2005
    So when you said I was using the wrong URL, you were just confused. Ok.
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited April 11, 2005
    jef,

    just to clarify, which method are you using...

    Upload via post or smugmug.images.upload ??


    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    jefjef Registered Users Posts: 42 Big grins
    edited April 11, 2005
    Ok, let's recap again.

    When I use XML-RPC to "http://upload.smugmug.com/hack/xmlrpc/ smugmug.images.upload", I get a method not found fault.

    When I use XML-RPC to "http://upload.smugmug.com/hack/xmlrpc/ upload", the upload succeeds but returns an empty string as the result, instead of the ImageID.

    When I try to use POST to "http://upload.smugmug.com/photos/xmladd.mg", I just get a timeout.
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited April 11, 2005
    Jef,

    I think the above mentioned doc is a be misleading...

    for xml-rpc uploads using smugmug.images.upload use url...
    http://upload.smugmug.com/hack/xmlrpc/


    for uploads via POST use url...
    http://upload.smugmug.com/photos/xmladd.mg

    Hope this helps,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited April 11, 2005
    jef wrote:
    Ok, let's recap again.

    When I use XML-RPC to "http://upload.smugmug.com/hack/xmlrpc/ smugmug.images.upload", I get a method not found fault.

    When I use XML-RPC to "http://upload.smugmug.com/hack/xmlrpc/ upload", the upload succeeds but returns an empty string as the result, instead of the ImageID.

    When I try to use POST to "http://upload.smugmug.com/photos/xmladd.mg", I just get a timeout.
    Has the 'Upload via POST' method ever worked for you ?

    I think you will find most people here you that method.

    Can you include your POSTDATA for the 'Upload via POST' method so we can have a look at it ?

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    jefjef Registered Users Posts: 42 Big grins
    edited April 11, 2005
    devbobo wrote:
    for xml-rpc uploads using smugmug.images.upload use url...
    http://upload.smugmug.com/hack/xmlrpc/

    for uploads via POST use url...
    http://upload.smugmug.com/photos/xmladd.mg

    Aren't those the URLs I just said I'm using? Am I failing to see some subtle difference in spelling or punctuation?
  • Options
    jefjef Registered Users Posts: 42 Big grins
    edited April 11, 2005
    devbobo wrote:
    Has the 'Upload via POST' method ever worked for you ?

    I had never tried it before this morning when the problems with the regular method cropped up. I'm sure I'm calling it wrong. However, if this upload method's idea of error reporting is to time out, I'm not real interesting in debugging my call.
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited April 11, 2005
    jef wrote:
    I had never tried it before this morning when the problems with the regular method cropped up. I'm sure I'm calling it wrong. However, if this upload method's idea of error reporting is to time out, I'm not real interesting in debugging my call.
    lol...i understand your frustration.

    My bet is that you're not creating the multi-part formdata correctly. With this method since you are posting data, like submitting a html form, if the data you post to the form is not correct, it is inconceivable that the page will never return anything.

    It's pretty simple to work through and this is the "preferred" method for uploading, since you don't have to do the base64 encoding.

    Just for reference here's sample postdata...

    --111222111
    Content-disposition: form-data;name="SessionID"

    [SessionID]

    --111222111
    Content-disposition: form-data;name="Version"

    1.0
    --111222111
    Content-disposition: form-data;name="AlbumID"

    [AlbumID]

    --111222111
    Content-disposition: form-data;name="ByteCount"

    [FileSize]
    --111222111

    Content-Transfer-Encoding: binary
    Content-disposition: form-data;name="filename";filename="[FileName]"
    Content-Type: image/jpeg
    Content-Length: [FileSize]
    [ImageData]
    --111222111--

    Hope this helps,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    jefjef Registered Users Posts: 42 Big grins
    edited April 11, 2005
    As I said I am not interested in debugging Upload via POST.

    What was the problem you saw with the URLs? I didn't see any difference between what I posted and what you posted.
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited April 11, 2005
    jef wrote:
    As I said I am not interested in debugging Upload via POST.

    What was the problem you saw with the URLs? I didn't see any difference between what I posted and what you posted.
    As it turns out there is no difference in the urls, I was composing that at the same time you were posting your reply.

    Sorry
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited April 11, 2005
    jef wrote:
    When I use XML-RPC to "http://upload.smugmug.com/hack/xmlrpc/ smugmug.images.upload", I get a method not found fault.
    jef,

    sorry I was half asleep when I read this originally. If you are getting 'method not found', then that is a problem, I had this with a few functions calls for this new API release. It obviously hasn't been picked up since most people don't use that call.

    Post this bug description as a new thread so that Don is more likely to see it.

    David
    David Parry
    SmugMug API Developer
    My Photos
Sign In or Register to comment.