一.前言
1.简介:
前篇文章,博客给大家介绍了如何基于Dragonboard410c借助python的django架构搭建自己的用户登陆注册系统。今天我们来单独介绍下如何实现让用户上传自己视频到服务器上。
2.工具:
图1 Dragonboard410c
图2 显示器
图3 鼠标键盘
图4 智能手机一部
二.主代码
1.主html
body{ font-size:14px;}
input{ verTIcal-align:middle; margin:0; padding:0}
.file-box{ posiTIon:relative;width:340px}
.txt{ height:22px; border:1px solid #cdcdcd; width:180px;}
.btn{ background-color:#FFF; border:1px solid #CDCDCD;height:24px; width:70px;}
.file{ position:absolute; top:0; right:80px; height:24px; filter:alpha
baseDir = os.path.dirname
jpgdir = os.path.join
filename = os.path.join
fobj = open
for chrunk in f.chunks
fobj.close
return render_to_response
else:
return render_to_response
三.效果实测:
打开手机访问你指定的服务地址,然后点击浏览拍摄,*后点击上传,即可在你的~/Video/static/jpg目录下找到手机上传过来的视频或者照片,以下是手机页面展示:
图5 主页面
图6 点击选择录像/拍照上传
四.demo分享:
http://pan.baidu.com/s/1hrS21eO