File Uploading using REST api's


#1

Hello everyone, please help me over file uploading :

  • Please suggest best way to upload and download files in Meteor JS.
  • Which one is the best to upload files on server’s local filesystem or file storage service like AWS-S3 etc.
  • How to upload file using REST api in meteor with handling technique on server.
  • We want to upload files like images and videos by consuming REST apis in meteor.
  • How to handle large files.

please help me and reply with refer link if u can.


Thanks …


DDP vs REST Backend
#2

Is it important to upload on the servers filesystem?

Otherwise if S3 is a viable option edgee:slingshot can do uploads without even hitting your server, much more scalable that way.


#3

CollectionFS does all of the above, I believe.


#4

No, storage does not matter, my main concern is How to upload file using REST api in meteor with handling technique on server.


#5

Yes, i know this but i want to upload file using REST api in meteor.


#6

which REST api are you trying to use ?


#7

i am writing own REST api in meteor.


#8

so okay then you need to learn how to use FS Collection then that’s all
read the doc on github


#9

I think CollectionFS uses HTTP (REST). Ask @aldeed.


#10

It’s no different from handling a Nodejs stream. You need to stream the request somewhere using Node streams and some appropriate npm package. To S3 or a persistent local temp directory, etc.

It’s pretty complex to get right, so I recommend CollectionFS. It sets up the rest APIs for you, and you can change their URL. Or you can create your own but still pass off the stream to CFS to handle the difficult stuff.


#11

My REST clients are android and ios and using meteor as the REST backend. In this particular case can anyone elaborate more. what i will do here. i have to to upload images and videos with some JSON.


#12

@lancy
Hey bro, have you found solution about uploading file through rest api with native android,?
I have the same problem and I have not found solution. May be you have
figure out your problem so you can share to me how to upload file.
Thank you

@timbrandin @ccorcos @aldeed @capensisma
Hey guys, I build a web service REST API from meteor and the client is native
android java. I wanna upload file from my android using rest or ddp. but
until now, i havent found the solution about uploading file via ddp or
using rest. Anybody wants to help me?


#13

@isdzulqor i didn’t find a very good solution yet. Here are some my findings you can try -

  1. you can convert file into base64 string than can store in mongoDB GridFS.
  2. or you can try this tutorial : https://www.codetutorial.io/meteor-server-file-upload/
  3. Last use amazon s3 file bucket api for the file uploading it is easy and return you a url then you can store that into your database.

We are using last solution - S3 for now. but surly in future i will find out some good solution for file uploading and @mdg is also working on this to provide a reliable solution.