Fork me on GitHub
#cljsrn
<
2021-05-17
>
hadils02:05:10

Hi I am desparate. I am writing a React Native app in Fulcro (I know there's a Fulcro channel, please keep reading). I am trying to do an image upload and I have tracked the problem down to the fact the the middle is formatting the FormData correctly, but the data going across the wire have mutlipart/form-data but the image/jpeg part is empty. I don't know how to solve this. This is not a Fulcro issue because I have traced the Fulcro library code to this FormData object. I am using an iOS simulator and have remove the Flipper pod to the best of my knowledge, but it still does not work. Any feedback would be greatly appreciated!!!

😕 6
wilkerlucio18:05:23

without knowing anything about your specific setup, a simple way to handle uploads in Fulcro without having to tap on custom remotes is to encode the image as base64 and send as a normal string

wilkerlucio18:05:01

or make it a completly separate part of the process, for example, if uploading to S3, you can do the regular upload first, get the final URL from it, and them save that

wilkerlucio18:05:38

also posting on #fulcro instead of here will show up for more people that have the Fulcro context 😉

hadils19:05:31

Thank you @U066U8JQJ. I will probably use base64.