いてづきブログ

情シスでやってみたことの備忘録

ExtJSのAjax.requestでファイルを扱う方法

binary: trueのオプションを設定すれば、response.responseBytesに格納されてくるのであとはblobを好きに扱える。

Ext.Ajax.request({
scope: this,
url: 'url',
binary: true,
method: 'GET'
}).then(function (response) {
var blob = new Blob([response.responseBytes], { type: 'application/pdf' });
}

引用の中での字下げのやり方がよくわからない…。
Markdown嫌い。