mawrya wrote:
Can anyone give a newbie a short example of how a file upload is accomplished via javascript?

You can do this using XMLHttpRequest instead. It should be simpler than messing with nsIUploadChannel.


function post() {
var sData = "apa=" + encodeURIComponent( String(new Date) );
var oXmlHttp = new XMLHttpRequest;
oXmlHttp.open("POST", "test.cgi", false);
oXmlHttp.setRequestHeader("Content-Type", application/x-www-form-urlencoded");
oXmlHttp.setRequestHeader("Content-Length", sData.length);
oXmlHttp.send(sData);
alert(oXmlHttp.responseText);
}


erik
_______________________________________________
Mozilla-netlib mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-netlib

Reply via email to