Here's will implement our design to upload and process images via our API.
- [Narrator] In this section, we're going to go ahead…and figure out how to upload a file.…Luckily, Slim has a few helpful functions,…like get uploaded files and get client file name…within the system itself to make things fast and easy.…So, without further ado, let's try it.…First, we're going to go over to our files section here,…and create a new directory called assets.…We want to make sure that when we upload a file,…it has somewhere to go.…Within that assets folder,…let's go ahead and be a little bit more specific…and create images.…
In case we have other assets later on, we'll have images…sorted out already.…We're already established that we need to go into…the post messages route here, so we'll start there.…We'll make the little bit of space for ourselves.…Let's start with an image path.…This will be wherever the final image ends up.…And luckily, in our database itself on the messages table,…we already have a space for that.…We'll call this image URL, which is just the field name…from the database.…We'll map that to image path.…
This course begins with a simple application specification and builds it one step at a time. Each chapter includes a key concept, with examples from other public APIs, and then shows how to build it yourself with Slim. Learn about URL routing, validating input, and generating response codes and hypermedia payloads. Like any project, the first implementation may be a little messy but don't worry. The last chapter covers refactoring and what it takes to scale and support the API going forward.
- Understanding the project goals
- Setting up the database
- Adding authentication in Slim
- Using cross-framework and authentication middleware
- Creating a read-write API in Slim
- Uploading files via the API
- Adding file security
- Creating payloads and response codes in Slim
- Scaling your API
Skill Level Beginner
PHP Date and Time Essential Trainingwith David Powers4h 31m Intermediate
PHP: Managing Persistent Sessionswith David Powers2h 41m Intermediate
1. Project Explanation and Goals
2. Authentication Options and Tradeoffs
Cross framework middleware1m 32s
3. Create a Read-Write API
4. File Uploads via API
5. Scale Your API
Next steps1m 46s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.