Cloudinary Blog

FTP API for Cloudinary: Real-Time Synchronization

Yuval Papish
By Yuval Papish
FTP API for Cloudinary: Real-Time Synchronization

tl;dr Diagrams and blueprints for FTPing on Cloudinary


As a robust, effective solution for managing digital media, Cloudinary offers a RESTful API for provisioning and maintenance. That API enables numerous operations, from basic ones like image uploads to advanced ones, such as creation of named transformations and AI-based search.

However, despite its versatility for programming languages and frameworks, RESTful API does not comply with File Transfer Protocol (FTP), which has been in use for 50 years. Not only are FTP clients user-friendly, they can also seamlessly upload, delete, or download files in bulk and synchronize with the file system in question, whether automated or otherwise.

We've created the 'FTP API for Cloudinary', which translates FTP API calls into Cloudinary RESTful API calls. The FTP API enables you to use standard FTP clients for managing media assets in your Cloudinary account. Using this FTP API, you can maintain work procedures that involve FTP transfers.

For example, suppose you migrate to Cloudinary and your organization is engaged with photography agencies. The agencies are used to sending their photoshoot files to you over FTP. You could take advantage of the FTP API for Cloudinary to avoid changing a smoothly working process, enabling a seamless transparent migration to Cloudinary.

This post demonstrates how to use FTP on Cloudinary through an example of real-time synchronization. A second example on bulk uploads will be the subject of part 2 of this series.

Note
The FTP API for Cloudinary is based on the Amazon Web Services’(AWS) Simple Storage Service (S3) and Python lambda. For the code in its entirety, see the blueprint in the Github repository.

The Process

The diagram below illustrates the process of a unidirectional synchronization of files to Cloudinary in real time with the FTP API.

Diagram

Here’s the step-by-step workflow:

  1. The FTP source uploads a file to the user’s S3 bucket. Be sure to set your bucket to accept Cloudinary’s bucket GetObject requests and to send event notifications. For details, see the blueprint.
  2. S3 notifications are sent to an AWS Lambda.
  3. The AWS lambda function sends an API Upload request to Cloudinary.
  4. Cloudinary uploads the file from the user’s S3 bucket.

This process has the following advantages over Cloudinary automated uploads because—

  • Your assets get automatically synchronized to your Cloudinary account without them needing to be accessed by a user (whereas Cloudinary auto-upload is triggered by an end-user request).
  • If any eager transformation was defined on those uploaded assets, then your user will not have to wait for it.
  • Cloudinary’s powerful search engine is on, geared up to deliver complete results set to your search criteria.
  • Newer versions of the same object are synchronized.
  • Deleted and renamed objects are synchronized.
  • The upload date is preserved.
  • Optionally, you can set up synchronization of metadata and customize permissions and access control for the uploaded objects.

Conclusion

Cloudinary's native API deftly mimics FTP tasks, making this FTP API for Cloudinary possible. As a result, FTP users can continue enjoying the simple and smooth experience typical of classic FTP operations. At the same time, you and your organization can enjoy all the media management benefits of Cloudinary, with every FTP'd file automatically synchronizing with your Cloudinary account. Do try it out!

Recent Blog Posts

New Learning Pathways From the Cloudinary Academy

In December 2019, Cloudinary launched its customer education platform, the Cloudinary Academy, replete with courses taught by the company’s experts on developer-oriented products and digital asset management (DAM) solution. The courses comprise interactive lessons and hands-on assignments, a proven way of familiarizing the audience with the course material and illustrating it with live examples.

Read more
Maya Shavin: How I Built My Website

Besides working as a senior front-end developer at Cloudinary, I'm also a content creator, a blogger, and an open-source developer. Follow me at @mayashavin and on mayashavin.com.

In the beginning, my website, mayashavin.com, was mainly for showcasing the status of my development projects and keeping me organized with my speaking schedule. Initially, I built it with Vue.js, later on switching to Nuxt.js (aka Nuxt) for a higher SEO score, and deployed it with Netlify. After some time, I added a blog section with Netlify CMS as the content management system (CMS). Everything was fine until I added more content and features, which led to a significant decline in the site’s performance. Also, the site design needed a modern look. So, I gave the site a makeover.

Read more
Automation Frees Up PetRescue’s Staff to Help Pets Find Their Forever Homes

As we spend more time at home, many of us are adopting pets for the joy, companionship and a surprising range of health benefits. In Australia, where our nonprofit customer PetRescue is located, there’s a shortage of pets to adopt. Last August, the Guardian reported that dog shelters in Australia emptied and adoption fees for puppies were running as high as $AUS1800.

Read more
Cloudinary and Contentful Make Modern Content Management Easier

I am pleased to share that Cloudinary and Contentful have joined forces to further streamline the creation, processing, and delivery of online content through Cloudinary’s digital asset management (DAM) solution and advanced transformation and delivery capabilities for images and video. What’s more, the partnership delivers a headless approach to DAM. By leveraging APIs for media management tasks, marketers and developers alike benefit from an integrated stack of optimized assets for optimization and automation. As a result, page loads are fast and beautiful, and at scale—with less overhead and effort.

Read more
Introducing Cloudinary's Nuxt Module

Since its initial release in October 2016 by the Chopin brothers as a server-side framework that runs on top of Vue.js, Nuxt (aka Nuxt.js) has gained prominence in both intuitiveness and performance. The framework offers numerous built-in features based on a modular architecture, bringing ease and simplicity to web development. Not surprisingly, Nuxt.js has seen remarkable growth in adoption by the developer community along with accolades galore. At this writing, Nuxt has earned over 30K stars on GitHub and 96 active modules with over a million downloads per month. And the upward trend is ongoing.

Read more