Before jumping right into the code for this, I wanted to mention two things:
- Yes, I’ve covered this in some detail a while back,
- And this is the second part of a two-part series.
If you’ve not read the first part, do it first. The idea is that the code will work in conjunction with what I’m going to cover in this post to make sure that both the client-side and the server-side are covered.
Ultimately, the reason for breaking it down like this is not just to make sure that things are done correctly, but also to make sure that the user has the most positive experience possible.
With that said, here’s how to go about uploading files in WordPress on the server-side.