tengo lo siguiente:
fil = file:///storage/emulated/0/Android/data/com.test/files/Pictures/7601d776-7ca4-44b0-99cf-d8c0bb4c14e9.jpg , ( Image.path para android Generado por react-native-image-crop-picker uso el siguiente código para enviar esto al backend, tiene un error con cloudinary mientras que Image.path para IOS fil = /Users/test/Library/Developer/CoreSimulator/Devices/.../data/Containers/Data/Application/.../tmp/react-native-image-crop-picker/.../.jpg no tiene un error. ¿Por qué es este el caso, ya que ambos se obtienen de Image.path para react-native-image-crop-picker ?
const res = await client.post('/upload-avatar',{fil},{headers:{ Accept : 'application/json', authorization: 'some JWT' }})parte trasera:
try{ const upload_result = await cloudinary.uploader.upload(req.body.fil, { public_id: `${user._id}_profile`, width:500, height:500, crop: 'fill' }) res.status(201).json({success:true,message: "good"}) }catch (error){ res.status(500).json({success:false,message: "Error"}) }por @Michalk: habilite la opción includeBase64 includeBase64: true para el selector
En lugar de usar Image.path : data:${image.mime};base64,${image.data}
const res = await client.post('/upload-avatar', JSON.stringify({ data: fil }), { headers: { 'Content-type' : 'application/json', authorization: 'JWT JWT } });