You would have to use either an ActiveX control or Java applet with a custom upload mechanism to attempt such a thing.
As for Gmail's system, they aren't submitting the file via XMLHttp, they are actually submitting the file to a hidden frame.
Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/