Rob Gonda's Blog

uploading a file via Ajax

It is not possible.

Lol, well, ok.... the XMLHttpRequest cannot send multipart/form-data, therefore, cannot upload files. There are two ways around this:
1) use an iframe. This can be transparent, e.g. using the dojo.io.bind will do it automatically.
2) use a pixel Flash movie. You can create a 1 pixel flash movie, interface with it using the external interface (Flash 8 required), and use the Flash buffer classes (Flash 9 required) to upload the file. The nice thing about this is that you get the total bytes transferred count, thus you can display an accurate progress bar.

I'll try to post an example of both options soon.

TrackBacks
There are no trackbacks for this entry.

Trackback URL for this entry:
http://www.robgonda.com/blog/trackback.cfm?CCE336CD-3048-7431-E421AD35CE80223B

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
This blog is running version 5.9.003. Contact Blog Owner