removed spliting , logging delete handler in filehandler

This commit is contained in:
sanjayk03-dev
2024-02-21 22:48:21 +05:30
parent 29fa7dee2b
commit a553a40dfa
2 changed files with 6 additions and 2 deletions

View File

@@ -103,7 +103,8 @@ module.exports = {
cache: "no-cache", cache: "no-cache",
}); });
if (response.status == 200) { if (response.status == 200) {
const text = (await response.text()).split(" ").join("\n"); const text = await response.text();
console.log("text: ", text);
this.newGcode = text; this.newGcode = text;
} else { } else {
console.error("error loading"); console.error("error loading");

View File

@@ -133,6 +133,9 @@ class FileHandler(bbctrl.APIHandler):
filebasename = os.path.basename(url_unescape(filename)) filebasename = os.path.basename(url_unescape(filename))
try: try:
filename=self.get_upload(filebasename).encode('utf8')
self.get_log('FileHandler').info(
'138 FileName: ' + filename)
with open(self.get_upload(filebasename).encode('utf8'), 'r') as f: with open(self.get_upload(filebasename).encode('utf8'), 'r') as f:
self.write(f.read()) self.write(f.read())
except Exception: except Exception: