我们有一个与django后端通信的react应用程序。每当react应用程序想要将一个文件上传到后端时,我们发送一个表单请求,其中一个字段是要上传的文件的句柄。这个字段作为一个InMemoryUploadedFile在Django端接收,它是一个带有某些chunks的对象,可以进行如下处理:
def save_uploaded_file(uploaded_file, handle):
"""
Saves the uploaded file using the given file handle.
We walk the chunks to avo