v2 Upload, fails with "unknown file type"

sjayapathisjayapathi Beginner grinnerRegistered Users Posts: 4 Beginner grinner
I'm attempting an upload via http://upload.smugmug.com, using OAuth. My POST headers look like this

X-Smug-AlbumUri - /api/v2/album/xxxxx
X-Smug-ResponseType - JSON
X-Smug-Version - v2
Content-Type - image/jpeg

My form data has the file contents. However, I always get this as my response -
{
    "stat": "fail",
    "method": "smugmug.images.upload",
    "code": 64,
    "message": "unknown file type"
}

I'm not entirely sure why I'm getting that... any inputs on what's happening here would be appreciated.

Comments

  • ktvoelkerktvoelker Sorcerer Registered Users Posts: 25 Big grins
    edited March 9, 2015
    The error message you are seeing means that the file is not recognized as a valid image file in a supported format. Are you having this problem with one particular image, or every image?
    Karl Voelker
    Sorcerer and API Guy at SmugMug
  • sjayapathisjayapathi Beginner grinner Registered Users Posts: 4 Beginner grinner
    edited March 23, 2015
    It was every image. On further investigation, I realised that it was because my message body was multi-part form data. Once I changed it to just the binary, it worked flawlessly.
Sign In or Register to comment.