I am writen following code by the combination of
XMLHttpRequest() and XPCOM FilePicker component.
dump("\n testFileUpload testing....");
var nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp =
Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker
);
fp.init(window, "Export Org Definition to:", nsIFilePicker.modeOpen );
file://fp.appendFilters(nsIFilePicker.filterXML |
nsIFilePicker.filterAll);
var res=fp.show();
if (res==nsIFilePicker.returnOK){
dump("\n File url: " + fp.file.path );
}
var httpRequest = new XMLHttpRequest();
httpRequest.open("POST", "http://192.168.100.105/myApp/upload.php", false,
null, null);
httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencod
ed");
httpRequest.send("file="+fp.file);
dump("\n Responce: " + httpRequest.responseText);
But it is not working, anything missibg here?
I also not got any help on 'sending a file throw XmlHttpRequest'.
Have you any Idea?
Thanks,
Sandesh Karalkar
--
SEE: http://in.geocities.com/skexz
"Doug Turner" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> unless your os provides a mount point for the remote server, the answer
> is no.
>
> Doug
>
> Sandesh Karalkar <sandesh wrote:
>
> > Is there any way to upload file on remote server directly
> > using XPCOM " filePicker " component?
> >
> > Thanks in advance
> > Sandesh Karalkar
> >
> > --
> > SEE: http://in.geocities.com/skexz
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom