Skip to content

Instantly share code, notes, and snippets.

@Tamal
Tamal / upload_snap.js
Last active May 30, 2024 17:44
React Native File upload using XMLHttpRequest
_uploadSnap() {
var url = 'http://example.com/upload'; // File upload web service path
var photo = {
uri: this.state.picturePath, // CameralRoll Url
type: 'image/jpeg',
name: 'photo.jpg',
};
var formData = new FormData();
formData.append("file", photo);