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

React Native upload image/video to meteor server #74

Closed
faavictoriano opened this issue May 16, 2016 · 15 comments
Closed

React Native upload image/video to meteor server #74

faavictoriano opened this issue May 16, 2016 · 15 comments
Labels

Comments

@faavictoriano
Copy link

Hello there, i try to upload image in from react-native to meteor using base64 encode for image and its working, but i would like to know if you have idea how to upload from external like react-native to Meteor Server with file path. i know that in heruko they use ephemeral filesystem, so i can use my own server to upload video/audio? any codes in react-native to meteor? i use DDP Client

Thanks

@dr-dimitru
Copy link
Member

I guess you can grab code of this lib, and copy/paste Client's part. As it's still JavaScript - it should work.
Deps (on client):

  • underscore
  • reactive-var (can be removed)
  • tracker (can be removed)
  • More info here

Files:

  • worker.js - The main worker
  • event-emitter.js - NodeJS-like events on client
  • files.coffee - The main file, it's well-documented so you can easily identify if it's client or server part (see @locus)

Not easy task, but if you have enough experience it won't take a lot of time.

@dr-dimitru
Copy link
Member

BTW why not use: https://github.com/hharnisc/react-native-meteor ?

@dr-dimitru
Copy link
Member

@faavictoriano any news on your end?

@faavictoriano
Copy link
Author

I will try this.. Thank you.. :) we are using ddp for connection.. And i
guess we can use react native for.meteor. actually we are using this before
On May 19, 2016 12:29 AM, "dr.dimitru" notifications@github.com wrote:

@faavictoriano https://github.com/faavictoriano any news on your end?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#74 (comment)

@dr-dimitru
Copy link
Member

@faavictoriano thank you for reply, let me know then.

@dr-dimitru
Copy link
Member

@faavictoriano any news on your end?

@dr-dimitru
Copy link
Member

dr-dimitru commented May 31, 2016

This issue will be closed on next week, due to issue starter silence. I assume it as fixed.

@faavictoriano
Copy link
Author

I fixed i pass video and audio using DATA URI and BLOB.. thanks

@noris666
Copy link
Contributor

noris666 commented Sep 4, 2016

@faavictoriano are you can send example to here ?

@gauravdhiman
Copy link

@faavictoriano, can you share your code to see how you achieved upoading files to Meteor from React-Native.

I am using react-native-meteor for integration between React-Native and Meteor but looks like it's CollectionFS capability is deprecated and is discouraged to be used.

A sample code of how you achieved file upload (both using base64 and and Data URI) will really be helpful.

@dr-dimitru
Copy link
Member

both using base64 and and Data URI

base64 and Data URI is the almost same thing, Data URI has mime-type prepended to the data.

@gauravdhiman can you get an event when user selects the file? Something like in input[type="file"]?? Sorry not familiar with react-native

@gauravdhiman
Copy link

@dr-dimitru, yes I can get file object whenever user selects file(s). I am planning to use, react-native-image-crop-picker react component for this.

Once I get the file object, how to upload it to Meteor or 3rd party cloud APIs ? I would prefer Meteor.

@dr-dimitru
Copy link
Member

@gauravdhiman can react-native-image-crop-picker return Base64 encoded string?

@gauravdhiman
Copy link

@dr-dimitru, that I can convert on the fly.

Anyway more preferred way is to send binary data (image) and not converting it to base64. Send binary to Meteor and binary in Mongo GridFS. If that is not possible, I am ok with base64 in that case.

Please share the sample code, if possible.

@dr-dimitru
Copy link
Member

dr-dimitru commented Sep 19, 2017

@gauravdhiman you can find everything you need in wiki:

Let me know if this helped you

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

No branches or pull requests

4 participants