Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #25583

Re: How to load binary image with Javascript with NO BASE64 conversion

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail
From Richard Maher <maher_rjSPAMLESS@hotmail.com>
Newsgroups comp.lang.javascript
Subject Re: How to load binary image with Javascript with NO BASE64 conversion
Date Mon, 28 Jul 2014 18:04:21 +0800
Organization Aioe.org NNTP Server
Lines 33
Message-ID <lr5776$all$1@speranza.aioe.org> (permalink)
References <lr1ns0$7hd$1@speranza.aioe.org> <lr2mgf$sed$1@dont-email.me>
NNTP-Posting-Host uYFkdLFMFILrcerhBCvdBA.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.javascript:25583

Show key headers only | View raw


On 7/27/2014 7:06 PM, Denis McMahon wrote:
> On Sun, 27 Jul 2014 10:23:55 +0800, Richard Maher wrote:
>
>> Can someone please provide an example of loading a binary image file
>> that is being streamed from a server and accessed via an AJAX call?
>
> See https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest and
> associated material.
>
Thanks Denis.

For anyone else needing an example the one at this site looks best to me: -
http://www.html5rocks.com/en/tutorials/file/xhr2/


:               :                  :                  :

xhr.responseType = 'blob';

xhr.onload = function(e) {
   if (this.status == 200) {
     var blob = this.response;

     var img = document.createElement('img');
     img.onload = function(e) {
       window.URL.revokeObjectURL(img.src); // Clean up after yourself.
     };
     img.src = window.URL.createObjectURL(blob);
     document.body.appendChild(img);
     ...
   }
};

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to load binary image with Javascript with NO BASE64 conversion Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2014-07-27 10:23 +0800
  Re: How to load binary image with Javascript with NO BASE64 conversion "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-27 09:44 +0200
    Re: How to load binary image with Javascript with NO BASE64 conversion Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2014-07-27 17:03 +0800
      Re: How to load binary image with Javascript with NO BASE64 conversion Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-07-27 14:35 +0200
      Re: How to load binary image with Javascript with NO BASE64 conversion Erwin Moller <erwinmollerusenet@xs4all.nl> - 2014-07-28 10:55 +0200
        Re: How to load binary image with Javascript with NO BASE64 conversion Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2014-07-28 18:09 +0800
          Re: How to load binary image with Javascript with NO BASE64 conversion Erwin Moller <erwinmollerusenet@xs4all.nl> - 2014-07-28 16:22 +0200
        Re: How to load binary image with Javascript with NO BASE64 conversion Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-07-28 21:55 +0200
          Re: How to load binary image with Javascript with NO BASE64 conversion Scott Sauyet <scott.sauyet@gmail.com> - 2014-07-28 20:00 -0700
          Re: How to load binary image with Javascript with NO BASE64 conversion Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-07-29 13:51 +0200
    Re: How to load binary image with Javascript with NO BASE64 conversion Eli the Bearded <*@eli.users.panix.com> - 2014-07-28 05:54 +0000
      Re: How to load binary image with Javascript with NO BASE64 conversion "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-28 10:05 +0200
  Re: How to load binary image with Javascript with NO BASE64 conversion Denis McMahon <denismfmcmahon@gmail.com> - 2014-07-27 11:06 +0000
    Re: How to load binary image with Javascript with NO BASE64 conversion Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2014-07-28 18:04 +0800
  Re: How to load binary image with Javascript with NO BASE64 conversion "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-07-27 10:46 -0700
    Re: How to load binary image with Javascript with NO BASE64 conversion "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-27 19:57 +0200
      Re: How to load binary image with Javascript with NO BASE64 conversion "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-07-27 12:25 -0700
        Re: How to load binary image with Javascript with NO BASE64 conversion "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-07-27 12:32 -0700
        Re: How to load binary image with Javascript with NO BASE64 conversion "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-27 21:58 +0200

csiph-web