期末作业打算用web.py写一个可以上传图片的网站,但是在上传图片的时候只能得到文件名,得不到选定的文件。
python代码如下
class signin:
def GET(self):
return render.layout(render.header(False,"",""),render.singin(""))
def POST(self):
post=web.input(image={})
print post
return post.image
html段代码如下(表单什么的就不写了)
<div class="form-group">
<div class="col-md-12">
<input id="image" name="image" type="file">
</div>
</div>