How to implement video file uploading on Dragonboard 410c with web server

I. Introduction

1 Introduction:

In the previous article, the blog introduced how to build your own user login registration system based on Dragonboard 410c with Python's django architecture. Today we will introduce separately how to enable users to upload their own videos to the server.

2. Tools:

Figure 1 Dragonboard410c

Figure 2 display

Figure 3 mouse keyboard

Figure 4 Smartphone

Second, the main code

Main html





Define the style of input type="file"












2.view.py

From django.shortcuts import render
From django.shortcuts import render,render_to_response
From django.http import HttpResponse, HttpResponseRedirect
From django.template import RequestContext
From django import forms
Import os

Def videosave(request):
If request.method == "POST":
f = request.FILES.get('fileField')
baseDir = os.path.dirname(os.path.abspath(__name__))
Jpddir = os.path.join(baseDir,'static','jpg')
Print('f.name =',f.name)
Filename = os.path.join(jpgdir,f.name)
Fobj = open(filename,'wb')
For chrunk in f.chunks():
Fobj.write(chrunk)
Fobj.close()
Return render_to_response('video.html',{'fileField':f.name})

Else:
Return render_to_response('video.html')

Third, the effect of the actual measurement:

Open your phone to access your designated service address, then click Browse to shoot, and finally click Upload, you can find the video or photo uploaded by your phone in your ~/Video/static/jpg directory. The following is the mobile page display:

Figure 5 main page

Figure 6 Click to select video / photo upload

Four.demo share:

http://pan.baidu.com/s/1hrS21eO

Poly Solar Panel 140-170w

Polycrystalline Solar Panel,160W Polysilicon Solar Panel,160W Solar Panel,Goal Zero Solar

Zhejiang G&P New Energy Technology Co.,Ltd , https://www.solarpanelgp.com

Posted on