小编Abu*_*qil的帖子

在django中使用相同的输入名称上载多个文件

我在上传具有相同输入名称的多个文件时遇到问题:

<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']对象下.我如何处理从这里上传的每个文件?

django upload file-upload file

20
推荐指数
2
解决办法
2万
查看次数

SQL:SELECT IN更快更好的做法?

如果我使用2个查询:

第一:查询所需的所有键/ ID

第二步:从tab1中选择*,其中tab1.id在(... ids list .. ,,)

ids列表可以有几千...

是明智的还是最佳的做法或建议做那样的事情?

sql

3
推荐指数
1
解决办法
2693
查看次数

标签 统计

django ×1

file ×1

file-upload ×1

sql ×1

upload ×1