Device image upload via API

Anton Tananaev2 years ago

If it's broken obviously it won't show you anything good in an image editor. I'm asking to check with a binary file viewer.

Victor Butler2 years ago

Ahh, how didn't I think of that. So when I view the file as ASCII then I get the exact same string that I am sending to Traccar. It seems Traccar doesn't convert it back to PNG.

Anton Tananaev2 years ago

Sounds like you just have to send the binary as is?

Victor Butler2 years ago

Hum, sending the binary directly with a POST I get Status code 415: HTTP 415 Unsupported Media Type - NotSupportedException (...).

It's a PNG file. Should I send any specific headers?

Anton Tananaev2 years ago

Again, compare with what Traccar app sends. It's clearly working there.

Victor Butler2 years ago

I did compare it and I am sending the same data. Png image with POST and content-type: image/png.

I also checked the Traccar API here, but I don't see anything related to accepted media types. Is there any way to see where this error comes from?

ushera year ago

Anton, Sorry to revive this post, but you mentioned something that's been going on with me.

I'm using the most current web version and when I replace the vehicle image it doesn't update, it only updates if I clear the browser cache.

Is there a way to avoid this and not have to clear the cache every time the photo is changed?

Anton Tananaeva year ago

Your problem has nothing to do with this thread. You just have a cache problem.