Skip to content

Upload file "Network request failed" with FormData in 0.85.0 #56404

@AlexCernik

Description

@AlexCernik

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions