In this lesson, we will look at uploading files with the Http::attach() syntax. We will build a profile system where users can upload and automatically optimize their avatar images using Cloudinary's Upload API.
![]()
What You'll Learn
By the end of this lesson, you will learn how to:
- Upload files using multipart form data with
Http::attach() - Implement file validation beyond basic HTTP status checking
- Track upload progress for better user experience
- Handle complex authentication with timestamp-based signatures
- Process rich metadata responses from cloud services
- Manage upload state and error recovery
Understanding Cloudinary's Upload API
Cloudinary is a cloud-based image and video management service that provides automatic optimization, transformation, and delivery.
It's a bit different from something like Amazon S3: in addition to storing files, Cloudinary automatically may process your uploads (resize/transform images) and provide rich metadata about the files.
Let me be honest right away: this is significantly more complex than the simple JSON APIs we've worked with so far. But it's exactly the kind of complexity you'll encounter with real file upload services.
The Big Picture: Profile Avatar System
Let me give you the code structure overview, and then we'll dive into...