Downloading a file
Hi!
Is there any way to download a file from http to the computer without using too much crazy activex?
System.Shell.Folder.copyHere("http:// ....") does not work. I need to download a picture, since there is no "Save picture as..." in gadget's context menu.
Thanks for any idea
[326 byte] By [
miloush] at [2007-12-29]
Thanks, that seems suitable.
It would be much easier if I could get the Shell.Item object for the URI, though (if you look for suggestions for future versions
)
On second thoughts, that's not going to work. You'll need to read the image via an XML request, but that has a limit on the amount of data you can read, so that will probably fail too:
var xmlReq;function loadImage(url) {
xmlReq = new XMLHttpRequest();
xmlReq.onreadystatechange = imageCheck;
xmlReq.open("GET", url, true);
xmlReq.send(null);
} function imageCheck() { if(xmlReq.readyState < 4) return;
if(xmlReq.status == 200) {// image may be in xmlReq.responseText;
}
xmlReq.abort();
} ActiveX is probably going to be your only solution, unfortunately.
Things are getting complicated a bit...but okay, I'll try. Do you have any idea what the limit is?
However, since I don't expect the file to exceed 100kB I guess it should work well.