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

345
Views
React native : images generating network error

When sending images to a react-native application, some image returns a Network Error.

I can not find the solution, because other image is sent perfectly. If anyone would have a solution for this problem!

React native application

let data = new FormData()
data.append('file', {
    name: picture.uri.split('/').pop(),
    type: picture.type,
    uri: picture.uri
})
await axios.post(URL, data, {
    headers: {
        'Accept': 'application/json',
        'Content-Type': `multipart/form-data;boundary='--${Date.now()}--'`
    }
}).catch(err => console.log('ERROR', err))

NodeJS server

const storage = multer.diskStorage({
    destination(req, file, cb) {
        console.log("destination", file)
        cb(null, '../../cloud/channels/')
    },
    filename(req, file, cb) {
        cb(null, Date.now() + path.extname(file.originalname))
    }
})

const upload = multer({
    storage,
    limits: {
        fileSize: 1024 * 1024 * 20
    }
})
app.post('/', upload.single('file'),(req: Request, res: Response) => {
    console.log('FILE', req.file)

    return res.status(200).json({
        result: 'ok'
    })
})

thanks in advance ๐Ÿ˜Š

about 4 years ago ยท Juan Pablo Isaza
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!