Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
¿Cómo enviar jpg al backend aunque a cloudinary?

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"}) }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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 } });
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!