diff options
author | Jose Antonio Marquez | 2012-02-08 13:11:48 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-08 13:11:48 -0800 |
commit | 4bfac53c9a77a3af35d029757eece53f4b7212ed (patch) | |
tree | 60c9881df445ada5c02ba22e5091b0bab0f92d1b /js/io/system/coreioapi.js | |
parent | 95808eb6ac82b8bf33de658bd135340b66a8fa29 (diff) | |
download | ninja-4bfac53c9a77a3af35d029757eece53f4b7212ed.tar.gz |
Fixed data type issue on copying library files
Fixed the methods to allow for ArrayBuffer data to be sent, fixes saving files that are not plain text.
Diffstat (limited to 'js/io/system/coreioapi.js')
-rwxr-xr-x | js/io/system/coreioapi.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index 7edb469b..e2c2e4dd 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js | |||
@@ -402,15 +402,16 @@ exports.CoreIoApi = Montage.create(Component, { | |||
402 | xhr = new XMLHttpRequest(); | 402 | xhr = new XMLHttpRequest(); |
403 | // | 403 | // |
404 | xhr.open("POST", serviceURL, false); | 404 | xhr.open("POST", serviceURL, false); |
405 | xhr.responseType = "arraybuffer"; | ||
405 | if(file.contentType && file.contentType.length) | 406 | if(file.contentType && file.contentType.length) |
406 | xhr.setRequestHeader("Content-Type", file.contentType); | 407 | xhr.setRequestHeader("Content-Type", file.contentType); |
407 | else | 408 | else |
408 | xhr.setRequestHeader("Content-Type", "text/plain"); | 409 | xhr.setRequestHeader("Content-Type", "text/plain"); |
409 | 410 | ||
410 | if(file.contents && file.contents.length) | 411 | if (file.contents) |
411 | xhr.send(file.contents); | 412 | xhr.send(file.contents); |
412 | else | 413 | else |
413 | xhr.send(); | 414 | xhr.send(); |
414 | 415 | ||
415 | if (xhr.readyState === 4) { | 416 | if (xhr.readyState === 4) { |
416 | retValue.status = xhr.status; | 417 | retValue.status = xhr.status; |