Ajax Binary Response

前端 未结 4 950
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 08:04

Hi I\'m wondering if there\'s anyway to stream a binary response in AJAX? This would be an ultimate solution otherwise I would need to realize the binary image to a file th

4条回答
  •  情深已故
    2020-11-30 08:26

    What you can do, if you are trying to generate an image on the fly, is to just do:

    
    

    then you can send the data with the appropriate mimetype.

    If you really want to send an image, then you may want to look at the HTML5 canvas tag, but I am not certain how excanvas would work with this, for being cross-platform.

    You could write to the canvas, but it would be more efficient to just use the img tag.

提交回复
热议问题