Upload Components for PHP and Flash
Have you ever had to add an upload feature to your site? I haven’t had to do this in many years, so I was pleasantly surprised when I looked around and found that there’s some fantastic components which make this really easy.
I stumbled across WebAppers which is a great blog-like catalog of free and open source components for web developers. The have a section just for upload components, and I quickly narrowed my search down to SWFUpload and FancyUpload.
The first thing that caught my eye is that these component developers don’t like to use spaces in the names of their products
.
I didn’t really have time to experiment with both of them, so I searched around for some quick reviews and it seemed like they were both excellent. Eventually I settled on SWFUpload because it looked a little more mature.
All in all, it was fairly easy to implement thanks to their straightforward demos. I had a functional upload component working in about 20 minutes which only needed minor tweaks.
It uses a hidden flash applet to accomplish the actual upload. It also polls the server and updates a progress bar on the page so the user doesn’t get too impatient.
A word of warning though. There did still appear to be some bugs, so I had to spend a few minutes searching for solutions. For the sake of Internet Explorer users, I would recommend using absolute paths when specifying the locations for the Flash applet and upload page.
This component does require some intermediate knowledge of JavaScript and PHP. For example, there are some common pitfalls when doing form-based uploads in PHP. Also, it relies on JavaScript and DOM manipulation to update the progress bar, so you’ll need to break out those JavaScript and CSS skills to customize it to the look and feel of your site.
All in all, SWFUpload is a solid product. If you’re ready to roll up your sleeves and crank out some JavaScript, CSS, and PHP, you can do some great stuff with this.