0

Looking though the docs, there are two ways of uploading files (images, videos, ...) to cloudinary using the node.js sdk.

Is there some way of getting progress reports when using either of the below specified methods? E.g 1 of 100mb have been uploaded.

cloudinary.v2.uploader.upload_large(filePath, options, (err, results) => {});
cloudinary.v2.uploader.upload(filePath, options, (err, results) => {});

1 Answer 1

1

For assets larger than this limit (100MB) you must request that the derived versions are created before they're requested, which we call 'eagerly', and that the processing takes place in the background ('asynchronously'). When using asynchronous eager transformations you can manipulate the asset as large as your account's maximum video/image file size limit.

Eager transformations can be requested for new asset in the upload API call or configured in an upload preset, including an upload preset that is used when you upload to Media Library. For existing videos, you can request eager transformations via the explicit API method. Once the video is transformed eagerly/asynchronously it will be available via the URL as normal.

For example in node:

cloudinary.v2.uploader.upload("sample.jpg", 
  { eager: [
      { width: 300, height: 300, crop: "pad" }, 
      { width: 160, height: 100, crop: "crop", gravity: "south"} ],                                   
    eager_async: true,
    eager_notification_url: "https://mysite.example.com/eager_endpoint",
    notification_url: "https://mysite.example.com/upload_endpoint" }, 
  function(error, result) {console.log(result, error); });
Sign up to request clarification or add additional context in comments.

1 Comment

Ok, but how is this related to getting upload progress back? What if I upload a file without any transformations?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.