parent
915542e696
commit
7b72d47070
1 changed files with 2 additions and 2 deletions
|
@ -328,7 +328,7 @@ Zotero.File = new function(){
|
||||||
*/
|
*/
|
||||||
this.putContentsAsync = function putContentsAsync(path, data, charset) {
|
this.putContentsAsync = function putContentsAsync(path, data, charset) {
|
||||||
if (path instanceof Ci.nsIFile) {
|
if (path instanceof Ci.nsIFile) {
|
||||||
path = this.fileToPath(path);
|
path = path.path;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof data == 'string' && (!charset || charset.toLowerCase() == 'utf-8')) {
|
if (typeof data == 'string' && (!charset || charset.toLowerCase() == 'utf-8')) {
|
||||||
|
@ -355,7 +355,7 @@ Zotero.File = new function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
var deferred = Zotero.Promise.defer(),
|
var deferred = Zotero.Promise.defer(),
|
||||||
ostream = FileUtils.openSafeFileOutputStream(file);
|
ostream = FileUtils.openSafeFileOutputStream(path);
|
||||||
NetUtil.asyncCopy(data, ostream, function(inputStream, status) {
|
NetUtil.asyncCopy(data, ostream, function(inputStream, status) {
|
||||||
if (!Components.isSuccessCode(status)) {
|
if (!Components.isSuccessCode(status)) {
|
||||||
deferred.reject(new Components.Exception("File write operation failed", status));
|
deferred.reject(new Components.Exception("File write operation failed", status));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue