我有以下HTML表单,它将一个文件上传到服务器
HTML:
<form id="form1" enctype="multipart/form-data" method="post" action="submit">
<input type="file" name="file" accept="text/plain,text/html,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"/>
<div><input id="submit_button" type="submit" value="Upload"/></div>
</form>在与文件对应的服务器上创建MediaIoBaseUpload对象的最佳方法是什么?
Python:
def post(self):
file = self.request.POST['file']
# How to create a MediaIoBaseUpload object from file?发布于 2015-04-14 00:01:33
这似乎是可行的:
media = MediaIoBaseUpload(file.file, mimetype=file.type, resumable=False)https://stackoverflow.com/questions/29597817
复制相似问题