A lot is going on at the island place in anticipation of our arrival, including maintenance and construction projects. I like for the contractors and the caretaker to send me pictures — it helps me not feel so far away. Alas, with the relentless improvements in smartphone cameras, pictures have gotten huge. I have a rather generous maximum file size on my email server, but a dozen full-size photos can still overwhelm it. It also seems that some systems (Exchange?) really limit outgoing message sizes. Yuck.

When I want to send pictures to somebody, it’s no problem. I can just put them on one of my web servers. And, yes, systems exist for sending pictures via an external server with links in email, but they all have privacy issues and other limitations. I wanted for people to be able to quickly and painlessly send arbitrary (and arbitrarily large) files directly to me. I decided it would only take “a few minutes” to put up a simple web page that would allow uploading files.

web page for uploading files

It was, in fact, quick and easy to get a page up with a file browser and a submit button. Unfortunately, there was nuance to deal with. I realized that it would have to have a password to protect it, or who knows what scary things internet randos might upload. I hard-coded in a passphrase, but that’s just too horrible as a security practice so I added a bcrypt hash. It looked like something out of the 90’s, which was fine with me, but I realized most people would be using it from a phone where it rendered much too small to be useful. I’m a style minimalist, but when it’s too minimal to see… So I added a few lines CSS from the best motherfucking web site to make it stylish and responsive. Much better. Oh, but you could only upload one file at a time, and people will often have a dozen or more pictures to send. So I added multiple file support. Whew!

Oh, then I realized I would have no way to know when someone had uploaded, so I added an email notification so I’d know when something was sent. And a previewer so folks could verify what they’d uploaded.

So now it’s done. Still only about a page of code. Responsive, multi-file support, reasonably secure. The code still needs a little clean-up, but it works pretty darn well.

Nuance addressed.

—2p

← previous|next →