Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File uploading, React Native #14

Open
djkmiles opened this issue Dec 1, 2017 · 1 comment
Open

File uploading, React Native #14

djkmiles opened this issue Dec 1, 2017 · 1 comment

Comments

@djkmiles
Copy link

djkmiles commented Dec 1, 2017

How does one set about uploading a file using this library, specifically using React-Native?

@djkmiles
Copy link
Author

djkmiles commented Dec 1, 2017

Here is some sample code:

ImagePicker.openPicker({
    width: 500,
    height: 707,
    cropping: true
}).then(image => {
    var Upload = {_className: 'Upload', file: {url: image.path, name: 'upload.jpeg', __type: 'File'}}
    console.log(Upload)
    Auth.shared.create('Upload', Upload, this.reload)
}, error => console.log(error))

ImagePicker is react-native-image-crop-picker
Auth.shared.create is my interface for calling Save(app, className, object, options)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant