Commit ad2f5fdd authored by Alain Takoudjou's avatar Alain Takoudjou

Edit only text file

parent 5789c3e9
......@@ -345,6 +345,9 @@ def removeSoftwareDir():
def getFileContent():
file_path = realpath(app.config, request.form['file'])
if file_path:
if not isText(file_path):
return jsonify(code=0,
result="Can not open a binary file, please select a text file!")
if not request.form.has_key('truncate'):
return jsonify(code=1, result=open(file_path, 'r').read())
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment