Base64 Encoding Of Model Binary ?

Discussion in 'Shapeways API' started by heckman13, Apr 5, 2017.

  1. heckman13
    heckman13 Member
    So it looks like you need to encode the binary files (models) with base64 encoding before uploading using the API? Can anyone confirm this? Also, I'm using Python Libraries, and do not fully understand the base64(a,[ ] ) standard with alternate library.... so using the basic encode... anyone know if this works ?
  2. stonysmith
    stonysmith Well-Known Member Moderator
    Yes, it requires Base64 encoding, but you can do that within python.

    Go look at the code in this thread: Inside there is an uploader that works. It is still written for Oauth1.. I'm working on the update for Oauth2, but that doesn't change the requirement for Base64 encoding.
  3. heckman13
    heckman13 Member
    Thanks for the link and the code.... I actually have all of the Oauth Stuff working... just needed a kick in the pants for the file encoding... I keep getting this error that says ...

    no file, no fieldname from shapeways.API.... I will keep at it! Thanks!
  4. heckman13
    heckman13 Member
    Acutally now I keep getting THIS error from Shapeways....

    {u'reason': u'Field <file> is required, but missing.\nField <fileName> is required, but missing.', u'result': u'failure'}

    Do the fields need to be in order ?
  5. heckman13
    heckman13 Member
    well now, just got it working... so thanks for the help!