Building a User Avatar Component With Node.js & TransloadIt - Part 2

An excerpt from http://www.sitepoint.com/user-avatar-component-node-js-transloadit/, by @lukaswhite

In the first part of this series, we looked at TransloadIt — a file-processing service which specialises in processing images, videos and audio. If you haven’t read it yet, I’d urge you to do so now as it covers a lot of background concepts which you’ll need to understand in order to follow along with this part.

But enough of the reasoning, background and theory — let’s go through a practical example of how to use the service to handle some images in your own application.

For the purposes of this tutorial, we’re going to implement a user profile photo feature for an arbitrary application. We’ll use TransloadIt to do the following:

Intercept the file upload, uploading it not to your application but to their servers.
Perform server-side file checking, to ensure it meets certain criteria, such as whether it is indeed an image.
Create a number of different derivatives — e.g. sizes — of the uploaded image, such as various sized thumbnails along with a “medium” and a “large” version for user profile pages.
Transfer the resulting derivatives to an Amazon S3 bucket.
Display a thumbnail of the newly-uploaded image in our application.
Use the information returned from TransloadIt to let our application know where to find the resulting images, so that we can store a reference to them in the user records.
The first step is to build some templates containing assembly instructions.

Continue reading this article on SitePoint

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.