From the course: Advanced Express
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
File upload basics
- [Instructor] When we look at our registration form, we see that it already contains a file upload field. Now one could assume that this is sufficient to send a file to a server. Unfortunately, it's not that easy. Let's fill out the form and inspect the payloads to understand the problems so I'm just putting in some bogus data. Some password, and I will also choose a file to be uploaded and I'm opening from development tools I select preserve log so that the redirect won't clear the history and I click submit. Now when I look into this registration request, we see on the bottom of the headers the request headers. If we scroll down in it, we see that there is also a section for form data. And there we see that we are transmitting a few fields. If we look at the source, we see that the data is encoded similar to a theory stream if we do a get request. We also see in the payload that while the file name of the uploaded image was sent, the binary data is missing. This is because, to…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.