Created
September 16, 2020 11:58
-
-
Save AmyrAhmady/6be61a9ea48a07c0a92a7cdacac1463f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let imageNumber = 1; | |
if (this.state.pic1 && this.state.pic1.uri) { | |
let obj = { | |
uri: this.state.pic1.uri, | |
type: this.state.pic1.type, | |
name: 'image.jpg', | |
}; | |
formData.append('Pic' + imageNumber, obj); | |
imageNumber++; | |
} | |
if (this.state.pic2 && this.state.pic2.uri) { | |
let obj = { | |
uri: this.state.pic2.uri, | |
type: this.state.pic2.type, | |
name: 'image.jpg', | |
}; | |
formData.append('Pic' + imageNumber, obj); | |
imageNumber++; | |
} | |
if (this.state.pic3 && this.state.pic3.uri) { | |
let obj = { | |
uri: this.state.pic3.uri, | |
type: this.state.pic3.type, | |
name: 'image.jpg', | |
}; | |
formData.append('Pic' + imageNumber, obj); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment