I'm writing a downloader chrome extension. I'm trying to fetch the file with ajax and encode it with atob(str)
but it only allows plain strings so can't get data:blah,base64
working.
Asked
Active
Viewed 471 times
1

user1528601
- 43
- 1
- 4
-
sorry,Kevin.I don't really want a library.But still thanks for English improvement. – user1528601 Jul 17 '12 at 12:17
-
http://stackoverflow.com/a/8022521/189093 – PAEz Jul 18 '12 at 21:25
1 Answers
0
You want to make an AJAX call to a binary file and get data:xxx/xxx;base64,xxx=
in return? This is not going to happen unless the file is returned by the server using Data URI scheme. You need to use xhr.responseBlob()
.
Similar question was asked before, and the answer there should help you. You can also check out this example.

Community
- 1
- 1

Konrad Dzwinel
- 36,825
- 12
- 98
- 105