HTML5 File API + XmlHttpRequest = SWFUpload, now what?

So what should you do if you decided to ditch SWFUpload and embrace HTML5 solution for ajax file upload? In honor of the releases of Firefox 3.6 (with File API), I decided to just that in the GFX Firefox promotion site. (sounds perfectly reasonable to use Fx-only technology on such site, right?) Firefox now gives us the bricks (File API, binary XHR, and File drag-drop), but to build a house it still takes some work. The Mozilla Hacks demo works great but to work with the existing site I need:

  1. To create a SWFUpload-like button that opens file selection dialog instead of HTML form file input.
  2. To send the file as a ordinary file upload form – no need to change php backend to handle raw post
  3. Send the file by jQuery.ajax, firing global callbacks

I came up with these methods to solve them:

Continue reading

慶祝與紀念

寫篇文章慶祝與紀念這個星期的風風雨雨。

慶祝在遇到如此複雜度的事情的關頭上,能夠找到夠多的朋友與家人的溫暖與陪伴,以及擁有足夠的成熟與 capacity 。

紀念逝去的天真,還有那個大家都可以好好相處永遠當好朋友的美好想像。

There are life challenges ahead. I won’t back down.