I am trying to Upload a myfile.min.js to sharepoint online using JavaScript using JSOM but its stored as wrong encosing format
var req = jQuery.ajax({
url: sourceFileItem + '?ver=' + ((new Date()) * 1), // add unique query string variable to prevent browser caching issues
type: 'GET',
cache: false,
dataType: 'text',
contentType :'text/plain; charset=UTF-8'
}).done(function (contents) {
ajaxDeffer.resolve({ 'url': sourceFileItem, 'contents': contents });
.................etc
var createInfo = new SP.FileCreationInformation();
createInfo.set_content(new SP.Base64EncodedByteArray());
for (var i = 0; i < contents.length; i++) {
createInfo.get_content().append(contents.charCodeAt(i));
}
createInfo.set_overwrite(true);
createInfo.set_url(sourceFileUrl.substring(sourceFileUrl.lastIndexOf('/') + 1));
...etc
context.executeQueryAsync(
the original content : "False-positive on some BlackBerry 6.0 builds -
the result content for the file
any help please ?