Lessons I’ve learned working with Flash File Uploaders
For the last two weeks I’ve worked with two Flash File Uploaders:
I this post I’ll describe the problems I had with it and how I solved them.
Lesson 1: NO COOKIES
If you add the uploader to authentication based application you might see no files actually got uploaded.
Why is that? your/clients cookies are not recognizable with the Flash Uploader, so the uploader is like every other intruder that need to perform a login.
How I found out? Luckily I used Fiddler2 [more about it later] and the error/debug messages logging system I had helped me to find out what went wrong.
Solution? All modern uploaders support custom post data, so you can use it for session tokens or PHPSSID.
Lesson 2: Upload URL isn’t Found?
On my old development server I had the strangest problem ever – the existing-not-authenticated url that uploads the files was not found by the script.
I’ve activated Fiddler2 and saw that the response headers were 302 – not found. My logging messages showed me that no one accessed the url.
Why is that? In my case the problem was in my old development server provider – they have some mechanism that filters requests for some reason.
How I found out? This is the place to thank Fiddler2 – Fiddler2 is a HTTP monitoring software and FireFox addon that.. monitors HTTP requests. With Fiddler2 I saw the response headers and after few tryouts I’ve got as a response an abuse page of my server provider.
Solution? I contacted my server provider and they did what they had to in order for my uploader to work.
Lesson 3: Don’t be rude to Mac
Meanwhile, I switched the flash uploader and start using SWFUpload which is much much better in my opinion.
My upload script contains photo resizing and uploading to a distant server. Every special event is logged, every suspicious action is logged.
The nature of those flash uploaders is uploading the file, and then they reach 100% – but no Complete event because my script running now the resizing stuff.When the script finished, the uploader moved to the next file in queue, but for Mac users, even after the resizing, the file never got the “Complete” event.
Why is that? As I said, every little even in the upload process is logged, if something bad happens I know how to handle it. I didn’t echo/print any response, because I don’t need to, but Mac have to get some kind of response in order to move on. Its not clear to me why, but that’s the way it works.
How I Found Out? really, just searched the web.
Solution? just echo something..it might be useful if you wish to return event to the uploader and let him handle it.

