上传大量图片到服务器并保存在服务器上的最佳方式是什么?在
我试图从如下表单中获取文件:
<form action="/upload" method="post">
<div class="form-group">
<label for="gallery">Select images:</label>
<input id="gallery" type="file" name="gallery" accept=".gif,.jpg,.jpeg,.png" multiple>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
控制器如下所示:
^{2}$但很明显它没用,而且“request.files.getall('gallery')”返回null。在
我也用了瓶子请求表单.getall('gallery')”但此函数只返回文件名,而不返回文件流。在
有什么想法吗?在
对于我的个人瓶子项目,我在客户端使用了开源的
plupload
JS库,并为瓶子做了一个小包装。在您可以安装它:
然后使用它:
^{pr2}$更多示例请看https://github.com/JonathanHuot/bottlepy-plupload。在
相关问题 更多 >
编程相关推荐