

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 8
click for more info
Not enough gems
Cost: 6 gems
1: Welcome
incomplete
2: Large Files
incomplete
3: Database
incomplete
4: Videos
incomplete
5: Multipart Uploads
incomplete
6: Encoding
incomplete
7: Using the Filesystem
incomplete
8: Mime Types
incomplete
9: Live Edits
incomplete
This lesson's interactive features are locked, please to keep using them
Great, now we're using base64 strings in our SQLite database to store images... let's talk about why that actually kinda sucks.
It's usually a bad idea to store large binary blobs in a database. There are exceptions, but they are rare. So what's the solution? Store the files on the file system. File systems are optimized for storing and serving files, and they do it well.
Let's update our handler to store the files on the file system. We'll save uploaded files to the /assets directory on disk.
http://localhost:<port>/assets/<videoID>.<file_extension>
Run and submit the CLI tests.