Tyler Robertson

awww yeah it's image upload time bay-bee 😎

Thursday, October 12, 2023

My one complaint about my blogging setup (which I built myself and you can use!) is that I haven't had a great method for handling images. Previously I used third-party services, but as their pricing models and terms of service changed I felt less and less comfortable with that.

So, as part of figuring out what to do with this blog moving forward, I added an image uploading feature! It lets me host photos as part of this very site, like this shot I took at a Durry concert a few weeks ago:


It uses multer, a middleware that lets me send multipart/form-data requests to my express server (which I can do either with curl or an iOS/MacOS Shortcut), and saves the file to the disk using whatever parameters I want. In this case, I've got a modest file size limit, and automatically rename the files with the current timestamp for easy sorting.

The feature is very much a beta and isn't a part of Oregano yet, because there's a real good chance I'll blow past my Glitch storage limit with it. But, it does mean I can start sharing more photos of my arts and crafts here, and may inspire me to start blogging in earnest again. ✨