实现文件上传的多种方法
一、Form表单上传
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>上传文件</title>
</head>
<body>
<form action="/update.html/" method="POST" enctype="multipart/form-data">
{% csrf_token %}
<input type="text" name="user">
<div style="position:relative;">
<a>选择文件</a>
<input type="file" name="img" style="opacity:0;position:absolute;top:0;left:0;height:16px;width:64px;">
</div>
<input type="submit" value="提交">
</form>
</body>
</html>
<!DOCTYP