> ## Documentation Index
> Fetch the complete documentation index at: https://cloudinary.com/documentation/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload images in Node.js (video tutorial)

[githublink]: https://github.com/cloudinary-community/cloudinary-examples/tree/main/examples/node-image-upload

## Overview

Learn how to upload assets in Node.js using the Cloudinary Node.js SDK.

## Video tutorial

  This video is brought to you by Cloudinary's video player - embed your own!Use the controls to set the playback speed, navigate to chapters of interest and select subtitles in your preferred language.

> **TIP**: :title=View the code

You can find the code from this tutorial in [GitHub][githublink].
## Tutorial contents
This tutorial presents the following topics. Click a timestamp to jump to that part of the video.
### Upload one image using the Node.js SDK
{table:class=tutorial-bullets}|  | 
| --- | --- |
|{videotime:id=media :min=0 :sec=15 :player=cld} | Having [installed and configured the Cloudinary Node.js SDK](node_configuration_tutorial), you can upload an image using the `upload` method of the [Upload API](image_upload_api_reference#upload).  For example:
|

```nodejs
const image = './images/my_image.jpg';

cloudinary.uploader.upload(image).then(result => {
  console.log(result);
})
```

### Use the async await syntax
{table:class=tutorial-bullets}|  | 
| --- | --- |
|{videotime:id=media :min=0 :sec=57 :player=cld} | Alternatively, you can use the async await syntax.  For example:
|

```nodejs
const image = './images/my_image.jpg';

(async function run() {
  const result = await cloudinary.uploader.upload(image);
  console.log(result);
})();
```

### Upload multiple images
{table:class=tutorial-bullets}|  | 
| --- | --- |
|{videotime:id=media :min=1 :sec=33 :player=cld} | If you want to upload multiple images you can loop through an array, calling the same function.  For example:
|

```nodejs
const images = [
  './images/image1.jpg',
  './images/image2.jpg',
  './images/image3.jpg',
  './images/image4.jpg',
  './images/image5.jpg',
];

(async function run() {
  for (const image of images) {
    const result = await cloudinary.uploader.upload(image);
    console.log(result.secure_url);
  }
})();
```

### Upload using an image URL
{table:class=tutorial-bullets}|  | 
| --- | --- |
|{videotime:id=media :min=2 :sec=06 :player=cld} | So far we've been using local file paths, but you can use [many different file sources](upload_parameters#required_file_parameter) for your images, for example an image URL:
|

```nodejs
const url = 'https://example.com/myimage.jpg';

(async function run() {
  const result = await cloudinary.uploader.upload(url);
  console.log(result);
})();
```

## Keep learning

> **READING**:
>
> * Learn more about [uploading images and videos using the Node.js SDK](node_image_and_video_upload).

> * Take a look at our [Upload guide](upload_images) to learn about uploading to Cloudinary in general.

> * Use the [Upload API reference](image_upload_api_reference) to find all the options and parameters available for the SDK.

> * Watch more [Dev Hints videos](https://www.youtube.com/playlist?list=PL8dVGjLA2oMpaTbvoKCaRNBMQzBUIv7N8) on the [Cloudinary YouTube channel](https://www.youtube.com/cloudinary).

#### If you like this, you might also like...

  
  
  
    Configure the Node.js SDK
    Install and configure the Cloudinary Node.js SDK 
  

  
  
  
    Upload Videos in Node.js
    Upload videos to Cloudinary using the Node.js SDK 
  

  
  
  
    Upload Widget
    Embed an Upload Widget in your site 
  

&nbsp;

&nbsp;Check out the Cloudinary Academy for free self-paced Cloudinary courses on a variety of developer or DAM topics, or register for formal instructor-led courses, either virtual or on-site.
&nbsp;