惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CERT Recently Published Vulnerability Notes
U
Unit 42
T
The Blog of Author Tim Ferriss
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Securelist
L
Lohrmann on Cybersecurity
Blog — PlanetScale
Blog — PlanetScale
Recorded Future
Recorded Future
D
DataBreaches.Net
Spread Privacy
Spread Privacy
T
Threat Research - Cisco Blogs
I
Intezer
P
Palo Alto Networks Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
I
InfoQ
宝玉的分享
宝玉的分享
Security Latest
Security Latest
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threatpost
Cisco Talos Blog
Cisco Talos Blog
P
Proofpoint News Feed
博客园 - 司徒正美
H
Hacker News: Front Page
Y
Y Combinator Blog
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
NISL@THU
NISL@THU
月光博客
月光博客
有赞技术团队
有赞技术团队
Cloudbric
Cloudbric
酷 壳 – CoolShell
酷 壳 – CoolShell
G
Google Developers Blog
A
Arctic Wolf
博客园 - 【当耐特】
W
WeLiveSecurity
V
Visual Studio Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
V
V2EX
C
Cyber Attacks, Cyber Crime and Cyber Security
S
SegmentFault 最新的问题
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog

Tornado

docker 多进程部署 tornado - V2EX Tornado 如何拿到传输的文件流 - V2EX Tornado 的异步 怎么写的 - V2EX tornado 下 ckeditor 图片上传问题 - V2EX Tornado 异步怎么写的? - V2EX tornado 怎么能确保端口挂了 服务也不会停止? - V2EX Tornado 路由有什么好方法,一个一个写太麻烦了,有没有根据 url 和注解匹配的方法呢 - V2EX Tornado V4.5 release pypy 拿到赞助之后出了支持 Python3.5 的版本 - V2EX tornado 做后台服务,如果前端没有用 cookie. - V2EX tornado 优秀项目推荐 问一个 tornado 解决阻塞的方案问题? - V2EX tornaqiniu(基于 tornado 的异步七牛 sdk) tornado 并行异步,如何保证在只有部分请求成功后,结果依旧可用。 - V2EX nginx 反向代理 tornado,如何 location 首页u rl? - V2EX 问一个关于 tornado 异常处理的新手问题 - V2EX tornado 的 coroutine 能和自定义的装饰器一起使用吗?? - V2EX Tornado 并发数很低,正常么? - V2EX 阅读 Tornado 源码过程中的一个疑惑,求解答 - V2EX gtornado - tornado 中 pymysql, pymemcache, storm orm 支持库 - V2EX Tornado 如何组织中大型项目,你们都是怎么样做的? - V2EX tornado 跑不通,小白求帮忙 - V2EX Tornado 4.3 发布 - V2EX Tornado 官方怎么不好好维护一个 sql 的异步数据库驱动? - V2EX 关于 tornado 阻塞的问题 - V2EX tornado 的 mysql 异步驱动性能测试 pypy 之 tornado - V2EX tornado 多个 url - V2EX RequestHandler 类的 get_current_user() 方法覆写无效 tornado 动态添加 url 的问题 tornado 怎么利用'next'参数进行页面跳转 finish() called twice 阿里云 ECS 1CPU 1G 1Mbs 跑 tornado 开多少进程合适? tornado.locale.format_date()的日期汉化问题 Tornado 分页问题求解! Tornado 开发中出错调试如何像 PHP 一样? - V2EX 新手完全不懂 tornado.concurrent.Future 有多少人 有付费学习 Tornado 的意愿,这是一个学习网站。 - V2EX 请问下 tornado 在 ios app 后台方面有成熟的实现吗? 新手求教关于 Tornado + SQLite 的两个问题 - V2EX Tornado 4.1 - V2EX 关于优雅地部署 Tornado 新代码的一种方式 - V2EX Tornado Template 如何获得 JavaScript 中的 var 变量? 学习 "Introduction to tornado" 提问 - V2EX 用 Tornado + Mongodb 开发要注意什么? - V2EX 用 Tornado 做的网站,大家在写测试的时候,一般都是怎么做的呢? - V2EX 分享本人基于 tornado 开发的应用层框架 - V2EX Nginx 多端口运行 Tornado 如何获取当前端口 - V2EX Tornado 框架如何写 MVC 模式? - V2EX
请教 tornado 文件上传问题
sylvos · 2017-01-05 · via Tornado

用下面的代码做文件上传,在自己电脑测试能够成功上传,到局域网其他电脑测试,显示 finished!了,但是没看到文件,请问前辈,是什么原因呢?该代码运行在 xp 系统上,上传文件夹已设置最高权限。
import tornado.ioloop
import tornado.web
import shutil
import os

class UploadFileHandler(tornado.web.RequestHandler):
def get(self):
self.write('''
<html>
<head><title>Upload File</title></head>
<body>
<form action='file' enctype="multipart/form-data" method='post'>
<input type='file' name='file'/><br/>
<input type='submit' value='submit'/>
</form>
</body>
</html>
''')

def post(self):
upload_path=os.path.join(os.path.dirname(__file__),'files') #文件的暂存路径
file_metas=self.request.files['file'] #提取表单中‘ name ’为‘ file ’的文件元数据
for meta in file_metas:
filename=meta['filename']
filepath=os.path.join(upload_path,filename)
with open(filepath,'wb') as up: #有些文件需要已二进制的形式存储,实际中可以更改
up.write(meta['body'])
self.write('finished!')

app=tornado.web.Application([
(r'/file',UploadFileHandler),
])

if __name__ == '__main__':
app.listen(3000)
tornado.ioloop.IOLoop.instance().start()