Spent a lot of today working with one of my new co-workers James. He seems like a fun guy. Apparently, he read my journal. I suggested he start one of his own. If you are reading this, start one.
On another note, I can't believe I am still at work. I am trying to finish this video uploading site for a contest they are hosting. Unfortunately, the magic that is my surebert multi file unloader is about to die as Flash Player 10 changed the way you can call the FileReference browse method and calling it from javascript is no longer an option. They want it to have a flash interface. Adobe says it makes it safer, I say it just makes it flashier and makes me mad.
I plan on creating a new multi file uploader widget based on my previous work

but I won't have time tonight and they needed a solution now. I decided to just use traditional file uploads seeing as they are only uploading one file.
Cool enough, but sadly you don't get the progress which is really the fun part of the surebert uploader. Luckily, there is a php extension

that allows you not only track how much of the file has been uploaded but how long it expects to take, the current speed, etc. Its really so easy and you can quickly get the data back via json. You add an extra random ID attribute to your form and it uses that as a key to track the file upload. Then you can make requests back to the server to get updates on the time remaining, etc. You make the requests via ajax which is really simple and great.
Sadly, after testing in IE6 and firefox and everything working, I tested it in Safari which refuses to receive ajax responses after it has initiated a file upload. I send them, it just won't process any responses. I hate you safari. Seriously, its always you that has to make everything fucked up.
Anyways, so I re-factored and ended up going with an iframe solution as safari was happy with that and so were the other browsers. Its cool to get an estimated finish time.
Oh ya, I realized that. I use that technique for the Flex embedded apps on the intranet I am developing but this upload button is only a button and should not require anything beside sthe code required for the upload which is like 5k. I am much happier with the Actionscript version as even though I was limiting what I was loading by very specific, it seemed like the smalled Flex MXML based app I could get was like 150k.
You can make smaller Flex apps if you use --static-link-runtime-shared-libraries=false. It's a tradeoff- the user's first download ever will be much larger, since they'll need to fetch the entire Flex library [~500k] in addition to your program code. [Whereas if you statically link, you get the program code plus only the parts of the library they use.] But subsequent requests for Flex apps that link against the same framework version, regardless of which domain they're from, will be much faster since they'll only have to download the program code. The library is stored in a special Flash cache separate from the browser cache, so it's very rare that they'd need to download it again.
:::link:::
:::link:::
- Z
My Flash was probably messed up from have half a dozen beta's of various adobe products and sdk's installed.
Thanks god, I was surprised because I developed it on the mac and tested safari, IE, and firefox. I was ready to kill myself if it didn't work. I have spent so much time on this crap after Adobe made they decision to not allow for FileReference.browse to be called from a non flash interface. I am still mad at them.
I reinstalled Flash (same version as in my last comment) and the problem went away. So nevermind :)
I'm having trouble uploading images with either Safari or Firefox, with version: MAC 9,0,124,0
If I click on the upload multiple images button, I get the spinning beachball and then am forced to quit out of the browser after a few minutes of no activity.
I'll try updating flash and seeing if that fixes it.
I tried it out. Very cool! :) I left you something on the surebert site. :D