Re: Using XmlHttpRequest to upload [binary] data
"Emmanuil Batsis (Manos)" <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Organization | Netsmart S.A., Greece |
| Message-ID | <[email protected]> |
Vladimir Kelman wrote: > Hello! > > I'm trying to write [JavaScript] code to upload [binary] files from > user's machine to a server (PHP page) using XmlHttpRequest object. You'll need to encode the binary file in base64 (possible with javascript, google for it) and wrap it in markup. > The very first question is how to attach a file to XmlHttpRequest? As I > understand I need to create something called a "stream" to do it. Is it > possible to do it in Mozilla and IE using JavaScript and possible XML? Yes, google for mozilola XML extras and microsofts implementation to find related docs. I dont see why you dont want to use plain HTML forms for this though asynchonous operation being the only pro; but easily emulated by wrapping the form in an iframe. ] hth manos