Download / convert image meteorjs

I need to upload a file to a meteor, do some manipulations with the image on it (if necessary, convert the image, generate a sketch from the image), and then save it to an external image storage server (s3). It should be as fast as possible. Do you have any recommendations for nodejs image processing library? Also how can I upload a file in meteorjs?

thanks

+4
source share
5 answers

I got the following solution:

1) meteorite server side route for custom download url

__meteor_bootstrap__.app.stack.splice (0, 0, { route: '/upload', handle: function (req,res, next) { //handle upload }.future () }); 

2) use the built-in nodejs module inside the function to upload files

+4
source

The simplest solution I found is using FilePicker.io. It integrates very easily into your Meteor app and connects directly to S3.

+4
source

In my start (hausor.com) I use https://github.com/CollectionFS/Meteor-CollectionFS and with additional plugins that it supports amazon S3 file upload and image scaling / cropping,

+3
source

I do not think Meteor has support for downloading; perhaps something is planned in the future. At the same time, I would either (assuming you can read the file using FileReader or something else):

a) paste the file in mongo and then delete it when it is saved to S3

b) save it to S3 from the client (not sure if there is a “safe” way to do this .. that is, without giving out your credentials, but it might be worth exploring).

c) [if you cannot use FileReader] use an iframe or something in POST to an external server that you can control, which handles downloads, and then communicates with it from the meteorite server.

0
source

Please check one of my answers here: Uploading and uploading files using a meteor

I use busboy to upload files and just use fs = Npm.require("fs") to write the file: Just put them inside busboy :, save to is the path you downloaded to, we just have APACHE or file hosting and use a different port On him.

file.pipe(fs.createWriteStream(saveTo))

0
source

All Articles