From 4bfac53c9a77a3af35d029757eece53f4b7212ed Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 8 Feb 2012 13:11:48 -0800 Subject: 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. --- js/io/system/coreioapi.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/io/system/coreioapi.js') 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, { xhr = new XMLHttpRequest(); // xhr.open("POST", serviceURL, false); + xhr.responseType = "arraybuffer"; if(file.contentType && file.contentType.length) xhr.setRequestHeader("Content-Type", file.contentType); else xhr.setRequestHeader("Content-Type", "text/plain"); - if(file.contents && file.contents.length) + if (file.contents) xhr.send(file.contents); else - xhr.send(); + xhr.send(); if (xhr.readyState === 4) { retValue.status = xhr.status; -- cgit v1.2.3