Base64 Encoding Of Model Binary ?

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

  1. 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: https://www.shapeways.com/forum/t/api-sample-code-bulk-uploader.26751/ 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. 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. 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. well now, just got it working... so thanks for the help!
     
  6. EchoSage
    EchoSage Member
    how did you manage to get it working?