Using fineuploader in node.js - node.js

I have a fineuploader server set up which handles uploads from the browser using the fineuploader library. I can't seem to find anywhere if I can upload from node.js as well. Is this possible? Can I create a Blob and pass it to fineuploader?

Fine Uploader is a browser-based upload tool. It was never designed to work server-side. If you'd like to send requests from a Node server, there are a number of library focused on that particular workflow, such as the request library.

Related

Upload Media files to MongoDB from Node.js server

I have a MEVN Stack app. This requires to upload media files to the database. From the client-side, I am posting a multipart type form which will send the file to the server through Axios. I don't know how to store that in the MongoDB database and retrieve the same.
What you are looking for, is creating an API in node.js to handle uploaded file. (You can use express.js to make your life easier if you are not already using it)
In Vue.js create a component to upload a file and store the files in the file system on the server might be in a folder that is accessible through the web server (like in a public folder).
Finally, save the URL to access the file in MongoDB so, you can reference it later. You can google for tutorials on this, an example is here.

using backend files nodejs

Sorry, It might be very novice problem but I am new to node and web apps and just have been stuck on this for couples of days.
I have been working with a API called "Face++" that requires user to upload images to detect faces. So basically users needed to upload images to my webapps backend and my backend would do an API request with that image. I somehow managed to upload the files at my node's backend using tutorial provided below but now I am struggling how to use those image files. I really don't know how to have access to those files. I thought writing just the filepath/filename would help but it did not. I am really new at webapps.
I used tutorial from here: https://coligo.io/building-ajax-file-uploader-with-node/
to upload my files at back-end.
thanks
You can also use the Face++ REST API node client
https://www.npmjs.com/package/faceppsdk
As per in documentation it requires a live URL on web. Then you have to upload your files into remote location (You may upload files to a Amazon S3 Bucket)
And also you check the sample codes from Documentation where you can upload directly to Face++

File upload node.js express

I am using Node JS as web API server, for the front end, I am using Angular 4, Android and IOS. I have successfully implemented file upload using post request. I am exposing only one port outside. I need to implement file upload with a progress bar. I have only worked with POST and GET requests in past.I am not getting how to implement it on the server and send the progress responses to the front end. Additionally is there any other method that can be used.
It would be of great help if someone could help me with this process
For file upload you can use DropzoneJS. Since you are using Angular for front end use Dropzone for Angular.
I was looking into it and heard socket.io can be used to achieve the same. i need to user sharp package on the streamed data
For the server side, I use the built in express routers using multer. Multer parses multipart form data and uses callbacks that play very nicely with express routers.
Then for the UI you need an element that can upload multipart form data. If your using HTML 5 then you should be able to use just about any library that is out there. I personally use Vaadin uploads. It's a nice drop in element that does all the work for you. It even has a nice upload bar and status built in.

AWS S3 Standard upload scheme vs Browser-based uploads in node

I'm trying to understand what are the implementation differences between a standard AWS S3 upload scheme (e.g. using aws-sdk) and browser-based uploads, particularly, in node.js.
I understand that in any case, there needs to be a server that will store my AWS credentials and sign the requests to S3.
But there's a bunch of things I don't seem to understand:
If I use a browser-based upload, I'll have an HTML form on the client side with the signature and the policy values in hidden fields that I get from my server. But if I use a standard scheme for uploading files, i.e. completely through my server, how exactly is it implemented? There's a lot of code examples on server side implementations, but what should happen on the client side? So, there will be an HTML form with action attribute pointing to my server's URL designated for file uploads, right? But what will actually happen? Will the file firstly get uploaded to my server's storage and then to S3? Or will it somehow use streaming or something? It really confuses me and I'd really appreciate some code example where there's both server and client side code.
What are the pros and cons of both uploading schemes? When should I favour one approach over another (my personal use case - video uploads in a multi-account system)?

How to send or stream base64 images with AJAX to Node.js Express server?

I am new to working with images in web development. We have a Node.js Express server that will run on Heroku and uses Cloudinary to store images.
Ideally we could save images directly to Cloudinary, but I am not sure if that's possible and we are afraid of putting our Cloudinary credentials on the client.
Assuming we must send images data to our server first instead of sending them directly to Cloudinary - if the images are encoded as base64 on the client, is it possible to stream the images from the client to the server - or must we send all the data at once? Either way, what headers do we use to send binary / base64 data?
is it possible to send or even stream binary data from the client to the server?
since it is a Node.js server, it would be ideal to use streams and to stream the file from our server to Cloudinary.
hope this makes sense, and info would be very helpful.
Why not using direct uploads from the client side to Cloudinary using the jQuery plugin?
This method supports both signed or unsigned uploads, when the signature can (and should) be generated on your server before rendering the page, for privacy reasons. Uploading from Base64 URI is also possible with this mechanism.
Note that Cloudinary's client-libraries also wrap this plugin and provide you with "off the shelf" solutions for embedding the upload-fields in your web app, with the signature already inside.
Let us know if you need any further guidance.

Resources