<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d6016338663470588542\x26blogName\x3dA+Guide+to+Hell\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://shasini.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://shasini.blogspot.com/\x26vt\x3d-3621103276626359617', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

About

"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt."

Downloading Binary Streams with Javascript XMLHttpRequest

This precious technique is researched & developed by Marcus Granado
Refer to http://mgran.blogspot.com/2006/08/downloading-binary-streams-with.html

Request binary stream in FF

load_url = function(url) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
var req = new XMLHttpRequest();
req.open('GET',url,false);
//XHR binary charset opt by Marcus Granado 2006 [http://mgran.blogspot.com]
req.overrideMimeType('text/plain; charset=x-user-defined');
req.send(null);
if (req.status != 200) return '';
return req.responseText;
}



Comments refer to working in IE

At 9/14/2006 9:50 AM , Ben said...
This sounds like a great way to fix this problem but unfortunately it doesn't seem to work in IE. I'm trying to preload images using this method but the Microsoft.XMLHTTP implementation of XmlHttpRequest unfortunately doesn't include overrideMimeType. I've tried to use req.setRequestHeader('Accept','text/plain; charset=x-user-defined') but this doesn't work either.

Any help would be greatly appreciated :)


At 9/14/2006 11:00 AM , Marcus Granado said...
Hi, Ben. I developed the technique above to work on Mozilla/Firefox, but I didn't test on IE or any other browser (BTW, IE understands x-user-defined charset). It would be interesting if you could sniff the http headers being sent by IE after using setRequestHeader() as you suggested, to see if the headers are really being modified and compare with the output of FF. You might also want to set the headers 'accept-charset' and 'content-type' to the charset/mimetype above and have a try.

Further, IE seems to be able to natively read binary raw bytes by reading the property 'XHR.responseStream', which FF lacks. Have e.g. a look here, here and
here.
Let me know if any of the above works.

Labels: ,

You can leave your response or bookmark this post to del.icio.us by using the links below.
Comment | Bookmark | Go to end
  • Anonymous Anonymous says so:
    January 26, 2013 at 1:39:00 PM PST  

    online payday loans http://www.legitpaydayloansonline2.com/ Fundpopog [url=http://www.legitpaydayloansonline3.com/]http://legitpaydayloansonline1.com[/url] Stype payday loans online Payday Loans Online If you really need fast cash, a that you payday loans direct to the people in your area. top

  • Anonymous Anonymous says so:
    March 11, 2013 at 5:43:00 AM PDT  

    Hi, its fastidious paragraph regarding media print, we all be aware of media is a enormous
    source of information.

    Also visit my web-site ... connect.efind.com top

  • Anonymous Anonymous says so:
    March 15, 2013 at 3:01:00 AM PDT  

    Generally, they're visuals that will be revised by means of enthusiast combined with listed on numerous comedy internet pages. It's almost always easy
    to make a joke about the way a cat ends up lying down or sitting.
    If you cannot get over something that went wrong in
    your life, remember this quote, 'Do not blame yourself for past errors.

    Here is my web-site :: http://100.42.52.164-static.reverse.mysitehosted.com/blogs/17061/20397/picking-sensible-methods-for-fun top

  • Anonymous Anonymous says so:
    March 16, 2013 at 1:53:00 AM PDT  

    Exercise can help to avoid menopause weight gain
    and reduce other risks including osteoporosis, heart disease, and arthritis.

    We know because they have done so for millions of other people.
    Nothing is more motivating than seeing physical proof of results.


    My page http://www.nextur.pl/wiki/index.php?title=Użytkownik:HarveyBer top

  • Anonymous Anonymous says so:
    March 16, 2013 at 4:22:00 AM PDT  

    With the New Year quickly approaching, many
    people are setting their sights towards
    total physical fitness. You may want to try the buddy system, as lot of people find that this motivates them tremendously.

    Take note also that you know how to perform the exercise well to avoid sickness and injuries in the future.


    Look at my homepage fitness tips and quotes top

  • Anonymous Anonymous says so:
    March 16, 2013 at 4:54:00 AM PDT  

    Countless teenage parties have been spiced up by this funny little
    game, and countless adolescent mischiefs have amused millions
    of young people. Well-mannered, handsome men, looking forward to earn some money, can apply online to Men2hire for.
    By looking at funny pictures and funny dog videos on
    the internet, the hours will slip away easily.


    My web site really funny pictures and jokes top

  • Anonymous Anonymous says so:
    March 17, 2013 at 1:43:00 PM PDT  

    I every time emailed this blog post page to all my contacts, because if like to read it next my links will too.


    Also visit my webpage ... online graduate certificates top

  • Anonymous Anonymous says so:
    March 21, 2013 at 10:11:00 AM PDT  

    Hi there I am so glad I found your blog, I really found you
    by error, while I was searching on Yahoo for something else,
    Nonetheless I am here now and would just like to say thanks
    a lot for a incredible post and a all round enjoyable blog
    (I also love the theme/design), I don't have time to go through it all at the moment but I have bookmarked it and also added your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the superb work.

    Have a look at my web page bio tech top

  • Anonymous Anonymous says so:
    March 31, 2013 at 3:39:00 AM PDT  

    Hi to every body, itís my first go to see of this weblog;
    this weblog carries awesome and actually excellent information in support of readers.


    My web site; Read the Full Write-up top

  • Anonymous Anonymous says so:
    March 31, 2013 at 1:17:00 PM PDT  

    Hello I am so delighted I found your site, I really found you
    by mistake, while I was looking on Askjeeve for something
    else, Nonetheless I am here now and would just like to say many thanks for a tremendous post and
    a all round exciting blog (I also love the theme/design), I don't have time to go through it all at the moment but I have book-marked it and also added in your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the awesome work.

    Feel free to visit my blog post Biotechnology and Bioengineering top

  • Anonymous Anonymous says so:
    April 1, 2013 at 8:33:00 AM PDT  

    If you have a website, you can use Google Trends
    for your website traffic to increase as well.
    Both the content and presentation of news are drastically different from what it used to be.
    I want to mention a part of the Prime Law (Twelve Visions
    Party) which is part of Neothink.

    Look at my page - Latest Daily News top

  • Anonymous Anonymous says so:
    April 4, 2013 at 8:19:00 AM PDT  

    Wow, thatís what I was exploring for, what a
    stuff! present here at this blog, thanks admin of this website.


    Also visit my blog; http://createpage.ru/ top

  • Anonymous Anonymous says so:
    April 9, 2013 at 9:19:00 AM PDT  

    Based on my own experiences I am going to make five
    recommendations that I wish someone had made to me to help take
    the fear out of fitness. You have to find a way to take the
    tips you learn and make maximum use of them.
    Remember; there is a difference between a fattening diet and a healthy diet.


    Here is my web blog ... http://100.42.52.164-static.reverse.mysitehosted.com/ top

  • Anonymous Anonymous says so:
    May 12, 2013 at 10:47:00 PM PDT  

    That is a very good tip especially to those fresh to the
    blogosphere. Simple but very precise informationÖ Thank you for sharing this one.
    A must read article!

    Also visit my page; angry birds online spielen top

  • Anonymous Anonymous says so:
    May 12, 2013 at 10:47:00 PM PDT  

    This website was... how do you say it? Relevant!! Finally I have found something
    that helped me. Kudos!

    Take a look at my website :: angry birds online spielen top

  • Anonymous Anonymous says so:
    May 15, 2013 at 12:52:00 AM PDT  

    Hi, I do think this is a great blog. I stumbledupon it ;) I am
    going to revisit yet again since i have book marked it.
    Money and freedom is the greatest way to change, may you be rich
    and continue to guide other people.

    Also visit my web site: Angry Birds Online Spielen top

  • Anonymous Anonymous says so:
    June 10, 2013 at 5:38:00 AM PDT  

    Thank you for the good writeup. It in reality used to be a leisure account it.
    Glance complicated to far introduced agreeable from you!

    However, how could we keep in touch?

    My page: options binary top