Samuel
@samuel.fm
ever have a solution to your problem so simple you want to die?
adding mime type to image upload 2 1 9
Samuel
how the hell did it work for like 2 months before and only now start breaking. ahhhhhhhhhhhhhhhhhhh
2 1
David Buchanan
After more digging, I have no idea why it broke. The uploadBlob handler does mime sniffing, which ought to always be able to detect jpegs, and override whatever mime was specified (or not) on upload
1 2
Samuel
I’ll go back to an old graysky version and see if it still works when I have a free moment. Very possible I did something to break it (maybe during the compression step?)
Samuel
Oh my bad. I swear I saw something to the contrary but it might have been just client-related
1
Samuel
super hard to debug network issues using React Native, in the end the problem was that @atproto/api uploadBlob wasn’t detecting the mime type so didn’t add the Content-Type header, which the server then rejected. Took me ages to figure out what was wrong tho
1 3
deck.blue
That's actually a really nice tip, let's see how Flutter handles this (I'm worried, file upload always gives me trouble somehow
1 2
Samuel
Yeah files suck in RN because they haven’t implemented Buffer for some reason?? So you spend a lot of time converting to base64 and back lol
1 1
deck.blue
Dart has a built-in dart:io package which makes surprisingly easy to work with files, do you need to upload in base64 then?
1 1
Samuel
No, but you can do if you want to I think. I don’t know much about the upload stuff tbh
1