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
import json | |
def writeToJSONFile(path, fileName, data): | |
filePathNameWExt = './' + path + '/' + fileName + '.json' | |
with open(filePathNameWExt, 'w') as fp: | |
json.dump(data, fp) | |
# Example | |
data = {} |
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
// Function form the react-native-image-picker library | |
ImagePicker.showImagePicker({ title: 'Select Image' }, (response) => { | |
// format the image data | |
const image = { | |
uri: response.uri, | |
type: 'image/jpeg', | |
name: 'myImage' + '-' + Date.now() + '.jpg' | |
} | |
// Instantiate a FormData() object | |
const imgBody = new FormData(); |