Image & Video APIs

Upload images in PHP (video tutorial)

Last updated: Jul-18-2025

Overview

Learn how to upload images in PHP using the Cloudinary PHP SDK.

Video tutorial


This video is brought to you by Cloudinary's video player - embed your own!

View the code
You can find the code from this tutorial in GitHub.

Tutorial contents

This tutorial presents the following topics. Click a timestamp to jump to that part of the video.

Introduction

Jump to this spot in the video  0:00 In this tutorial, you'll learn how to upload one or more images to Cloudinary using the PHP SDK, a crucial part of your workflow for managing visual media.

Upload a single image from your local file system

Jump to this spot in the video  0:15 This tutorial assumes you've already installed and configured the PHP SDK.
To begin uploading, import the necessary Cloudinary classes, create an instance of the UploadApi class, and call the upload method with the full path to your image. Here's a basic example using a file in your images/ folder:

Upload response

Jump to this spot in the video  0:51 Once executed, the script will return a response object containing metadata and the delivery URL. You can use the secure_url to access the uploaded image:

Upload multiple images from your local file system

Jump to this spot in the video  1:12 To upload multiple images, loop through an array of file paths and upload each one individually. Only the secure_url is printed for simplicity. You can also view all uploaded images in the Media Library.

Upload a single image from a remote URL

Jump to this spot in the video  1:52 You can also upload images hosted online by passing the image's direct URL instead of a local file path. Cloudinary will download and store the file:

Keep learning

Related topics

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

 

Cloudinary Academy

 

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.

 

✔️ Feedback sent!

Rate this page: