我在上传具有相同输入名称的多个文件时遇到问题:
<input type=file name="file">
<input type=file name="file">
<input type=file name="file">
Run Code Online (Sandbox Code Playgroud)
在django一边
print request.FILES :
<MultiValueDict: {u'file': [
<TemporaryUploadedFile: captcha_bg.jpg (image/jpeg)>,
<TemporaryUploadedFile: 001_using_git_with_django.mov (video/quicktime)>,
<TemporaryUploadedFile: ejabberd-ust.odt (application/vnd.oasis.opendocument.text)>
]}>
Run Code Online (Sandbox Code Playgroud)
所以这三个文件都在单个request.FILES ['file']对象下.我如何处理从这里上传的每个文件?
如果我使用2个查询:
第一:查询所需的所有键/ ID
第二步:从tab1中选择*,其中tab1.id在(... ids list .. ,,)
ids列表可以有几千...
是明智的还是最佳的做法或建议做那样的事情?