DJANGO 上传 image
1. html:
<input type="file" name="logo_path"/>
2. views:
logo_path = request.FILES.get('logo_path', '')
bf = logo_path.file.readlines()
f = file('/home/username/abc.jpg', 'wb')
for b in bf:
f.write(b)
f.close()
DJANGO 上传 image
1. html:
<input type="file" name="logo_path"/>
2. views:
logo_path = request.FILES.get('logo_path', '')
bf = logo_path.file.readlines()
f = file('/home/username/abc.jpg', 'wb')
for b in bf:
f.write(b)
f.close()