Front and rear ends django upload file upload files of 200 318

Here Insert Picture Description

  • method=‘post’
  • enctype = ‘multipart/form-data’
  • type=file

Here Insert Picture Description

The front-end code file upload

Here Insert Picture Description

View Code

Here Insert Picture Description

Get File Object

文件对象 = request.FILES.get()

Save the file object

Create a file handle to write a binary objects

for chunk in 文件对象.chunks():
	保存这个chunk
Published 298 original articles · won praise 1 · views 4057

Guess you like

Origin blog.csdn.net/whalecode/article/details/104942373