react / react/react-native

Upload file "Network request failed" with FormData in 0.85.0

Open
#56,404 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Resolution: PR Submitted
Dominant language
C++
Stars
127k
Forks
25.3k
Avg merge
1d 23h
Merged PRs (30d)
4

Description

Description

Hello, I currently do this in version 0.85.0 and I get the error Network request failed.

The image are

{
  name: 'IMG-20251203-WA0008.jpg',
  type: 'image/jpeg',
  uri: 'content://...' or 'file://...
}
const formData = new FormData(); 

formData.append('content', data.content); 
data.images.forEach((e, i) => formData.append('images', e));

const response = await fetch('url', { 
  method: 'POST', 
  body: formData, 
});
Steps to reproduce
const formData = new FormData(); 

formData.append('content', data.content); 
data.images.forEach((e, i) => formData.append('images', e));

const response = await fetch('url', { 
  method: 'POST', 
  body: formData, 
});
React Native Version

0.85.0

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info
System:
  OS: Linux 6.12 Debian GNU/Linux 13 (trixie) 13 (trixie)
  CPU: (4) x64 Intel(R) Core(TM) i3-3217U CPU @ 1.80GHz
  Memory: 2.34 GB / 7.63 GB
  Shell:
    version: 5.2.37
    path: /bin/bash
Binaries:
  Node:
    version: 24.12.0
    path: /usr/local/bin/node
  Yarn: Not Found
  npm:
    version: 11.11.1
    path: /usr/local/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "34"
      - "35"
      - "36"
    Build Tools:
      - 33.0.0
      - 34.0.0
      - 35.0.0
      - 36.0.0
    Android NDK: Not Found
IDEs:
  Android Studio: Not Found
Languages:
  Java:
    version: 17.0.17
    path: /usr/bin/javac
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 20.1.3
    wanted: 20.1.3
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.85.0
    wanted: 0.85.0
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Stacktrace or Logs
TypeError: Network request failed
    at anonymous (fetch.umd.js:567:31)
MANDATORY Reproducer

https://github.com/AlexCernik/rn-formdata-reproducer

Screenshots and Videos

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the mandatory reproducer and inspecting the fetch call that posts FormData with image URIs on Android. Trace the React Native networking path used by that request and compare its behavior with the reported Network request failed error. Done means the reproducer can upload the images successfully on React Native 0.85.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript, react-native
Domain
mobile, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.