Commit 3359bf34 authored by 张鹏程's avatar 张鹏程

修改文件上传路径的bug

parent 59ebcafe
......@@ -15,7 +15,7 @@ from service.InitHtml_Service import InitHtml # 初始化HTML
class ReportAnalysis(BaseHandler):
def post(self):
self._filepath = self.get_argument('filepath', default=None)
self._filepath = self.get_argument('filename', default=None)
self._isdownload = self.get_argument('isdownload',default=None)
if self._filepath == None or self._filepath == '':
self.write(JsonUtil.build_json(code = JsonUtil.Constants.Code_Params_Error,
......@@ -23,7 +23,7 @@ class ReportAnalysis(BaseHandler):
self.flush()
else:
filepath = self._filepath
filepath = settings.HTML_PATH+'/'+self._filepath
isFile = False
try :
with open(filepath, 'rb') as f:
......@@ -74,34 +74,3 @@ class ReportAnalysis(BaseHandler):
))
self.flush()
# import json
# outpath = r'/Users/zhangpengcheng/Documents/量化派代码管理/credit_report/html/provinces.json'
# with open(outpath,"w+",encoding="utf-8") as f:
# _json = json.dumps(Result.get_result())
# f.write(_json)
# f.close()
# filepath = r'/Users/zhangpengcheng/Documents/量化派代码管理/credit_report/html/一代征信报告/432325197803211379.html'
# filepath = r'/Users/zhangpengcheng/Documents/量化派代码管理/credit_report/html/一代征信报告/13082119950823527X.htm'
# filepath = r'/Users/zhangpengcheng/Documents/量化派代码管理/credit_report/html/一代征信报告/32052219780226051X.htm'
# filepath = r'/Users/zhangpengcheng/Documents/量化派代码管理/credit_report/html/一代征信报告/140427198607030038.htm'
# filepath = r'/Users/zhangpengcheng/Documents/量化派代码管理/credit_report/html/一代征信报告/330682198805122815.htm'
# filepath = r'/Users/zhangpengcheng/Documents/量化派代码管理/credit_report/html/一代征信报告/440421198210078001.html'
# def run(self):
# if self._target is not None:
# self._return = self._target(*self._args, **self._kwargs)
#
# def get_return(self):
# try:
# return self._return
# except Exception:
# return None
#
# def join(self):
# threading.Thread.join(self)
# return self._return
\ No newline at end of file
......@@ -15,7 +15,6 @@ class UpLoadFiles(BaseHandler):
else:
filepath = self._filepath
isFile = False
try :
with open(filepath, 'rb') as f:
with open(settings.HTML_PATH+'/'+self._filepath.split('/')[-1],'wb+') as f_to:
......
......@@ -38,19 +38,19 @@ def apps():
if __name__ == "__main__":
#app = apps()
#server = HTTPServer(app)
#[i.setFormatter(LogFormatter()) for i in logging.getLogger().handlers]
#tornado.options.parse_command_line()
app = apps()
server = HTTPServer(app)
[i.setFormatter(LogFormatter()) for i in logging.getLogger().handlers]
tornado.options.parse_command_line()
# #== 本地调试
#app.listen(20011)
#IOLoop.instance().start()
app.listen(20011)
IOLoop.instance().start()
tornado.options.parse_command_line()
app = apps()
http_server = tornado.httpserver.HTTPServer(app)
http_server.bind(options.port)
http_server.start()
tornado.ioloop.IOLoop.instance().start()
# tornado.options.parse_command_line()
# app = apps()
# http_server = tornado.httpserver.HTTPServer(app)
# http_server.bind(options.port)
# http_server.start()
# tornado.ioloop.IOLoop.instance().start()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment