Skip to content

Commit

Permalink
Allow request files to be overwritten if user has chosen that option
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Leamon committed Jan 18, 2011
1 parent 73d8a5c commit 2cf65cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions content/restclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ var restclient = {
fp.init(window, "Save As", nsIFilePicker.modeSave);
fp.appendFilters(nsIFilePicker.filterXML | nsIFilePicker.filterText);
var res = fp.show();
if (res == nsIFilePicker.returnOK){
if (res == nsIFilePicker.returnOK || res == nsIFilePicker.returnReplace){
var thefile = fp.file;
var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
.createInstance(Components.interfaces.nsIFileOutputStream);
Expand Down Expand Up @@ -567,7 +567,7 @@ var restclient = {
var output = JSON.stringify(outputObject);

var res = fp.show();
if (res == nsIFilePicker.returnOK) {
if (res == nsIFilePicker.returnOK || res == nsIFilePicker.returnReplace) {
var thefile = fp.file;
var path = thefile.path;
if (path.match("\.txt$") != ".txt") {
Expand Down

0 comments on commit 2cf65cb

Please sign in to comment.