A (Very) Simple File Manager in PHP

A while back I decided that I didn’t require my iPad any more so I sold it. On the whole I haven’t missed it until this week when I needed to do some testing for a project at work. Given that this was such a short term requirement buying an iPad just wasn’t sensible but I decided sitting in the local Apple store and spending half an hour doing the testing there was! However, part of what I needed to do was to save some screenshots and get them back to my work machine, something that the restrictions on the Apple store iPads make difficult.

The solution? I decided to write a simple web app that allowed me to upload and manage images from an iOS device (actually it works for pretty much any device mobile or otherwise). To begin with all I did was allowed the upload of files and then I extended this to list the uploaded files, view and delete them and finally, to download all files as a zip.

This all sits behind a password protected page on my web server and as a quick hack works pretty well, this is what it looks like:


The server side code makes use of a number of PHP’s file handling capabilities and so I thought that others might also find this useful to see.

I have taken this as an opportunity to make my first commit to GitHub where you can see the code here. It is only there to serve as a sample, rather than a shining example of best coding practice. Hopefully it will be of some use to you.