Javascript 如何在blueimp jquery下载程序中筛选要下载的文件
我正在尝试使用Blueimp jQuery文件上传程序。我搜索了wiki和文档,但找不到如何筛选可供下载文件的答案 我在经过认证的“受保护”区域内使用它。我已成功使用唯一id(例如UID-filename.jpg)为所有上载的文件添加了前缀,我将在经过身份验证的会话中使用该id。所以我要做的就是只选择那些UID正确的 显示下载表的jquery代码是:Javascript 如何在blueimp jquery下载程序中筛选要下载的文件,javascript,jquery,ajax,blueimp,Javascript,Jquery,Ajax,Blueimp,我正在尝试使用Blueimp jQuery文件上传程序。我搜索了wiki和文档,但找不到如何筛选可供下载文件的答案 我在经过认证的“受保护”区域内使用它。我已成功使用唯一id(例如UID-filename.jpg)为所有上载的文件添加了前缀,我将在经过身份验证的会话中使用该id。所以我要做的就是只选择那些UID正确的 显示下载表的jquery代码是: <!-- The template to display files available for download --> <s
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<!-- <tr class="template-download fade">-->
<tr class="template-download ">
{% if (file.error) { %}
<td></td>
<td class="name"><span>{%=file.name%}</span></td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
{% } else { %}
<td class="preview">{% if (file.thumbnail_url) { %}
<a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
{% } %}</td>
<td class="name">
<a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>
</td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
<td colspan="2"></td>
{% } %}
<td class="delete">
<button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">
<i class="icon-trash icon-white"></i>
<span>{%=locale.fileupload.destroy%}</span>
</button>
<input type="checkbox" name="delete" value="1">
</td>
</tr>
{%for(var i=0,file;file=o.files[i];i++){%}
{%if(file.error){%}
{%=文件名%}
{%=o.formatFileSize(file.size)%}
{%=locale.fileupload.error%}{%=locale.fileupload.errors[file.error]| | file.error%}
{%}其他{%}
{%if(file.thumbnail_url){%}
{% } %}
{%=o.formatFileSize(file.size)%}
{% } %}
{%=locale.fileupload.destroy%}
我在JS/Jquery方面不是很有经验。我很想知道下一步该怎么做。有人熟悉过滤这些文件的设置/选项吗?或者,我假设该文件是我怀疑可以过滤的文件名或路径数组。在PHP中,我可能会使用glob函数。有人在JS中有过这种经验吗
提前谢谢大家,
比尔使用插件
它适用于任何表,并且易于部署
包括依赖项:
<script src="/path/to/jquery.js"></script>
<script src="/path/to/bindWithDelay.js"></script> <!-- optional -->
<script src="/path/to/jquery.filtertable.js"></script>
<style>
.filter-table .quick { margin-left: 0.5em; font-size: 0.8em; text-decoration: none; }
.fitler-table .quick:hover { text-decoration: underline; }
td.alt { background-color: #ffc; background-color: rgba(255, 255, 0, 0.2); }
</style> <!-- or put the styling in your stylesheet -->
.filter表。快速{左边距:0.5em;字体大小:0.8em;文本装饰:无;}
.fitler table.quick:hover{text装饰:下划线;}
td.alt{背景色:ffc;背景色:rgba(255,255,0,0.2);}
输入代码
<script>
$('table').filterTable(); //if this code appears after your tables; otherwise, include it in your document.ready() code.
</script>
$('table').filterTable();//如果此代码出现在表之后;否则,请将其包含在文档的.ready()代码中。
好的!祝你好运!使用插件
它适用于任何表,并且易于部署
包括依赖项:
<script src="/path/to/jquery.js"></script>
<script src="/path/to/bindWithDelay.js"></script> <!-- optional -->
<script src="/path/to/jquery.filtertable.js"></script>
<style>
.filter-table .quick { margin-left: 0.5em; font-size: 0.8em; text-decoration: none; }
.fitler-table .quick:hover { text-decoration: underline; }
td.alt { background-color: #ffc; background-color: rgba(255, 255, 0, 0.2); }
</style> <!-- or put the styling in your stylesheet -->
.filter表。快速{左边距:0.5em;字体大小:0.8em;文本装饰:无;}
.fitler table.quick:hover{text装饰:下划线;}
td.alt{背景色:ffc;背景色:rgba(255,255,0,0.2);}
输入代码
<script>
$('table').filterTable(); //if this code appears after your tables; otherwise, include it in your document.ready() code.
</script>
$('table').filterTable();//如果此代码出现在表之后;否则,请将其包含在文档的.ready()代码中。
好的!祝你好运!我在解决方案方面取得了一些进展。我询问了github。插件作者建议我在服务器端进行筛选。我找到了一个解释如何在服务器端进行筛选的方法。我已经完成了这项工作,并且可以进行上传。我现在已经进行了设置,每个用户在上传文件夹中都有一个子文件夹,名为他们唯一的ID编号,其中包含他们的图像。1问题:上传的图像不可见。请查看链接已失效。我在解决方案方面取得了一些进展。我询问了github。插件作者建议我在服务器端进行筛选。我发现了这一点,说明了如何在服务器端进行筛选。我已经完成了这一操作,并且它与上载一样有效。我现在已经完成了t安装程序,其中每个用户在上载文件夹中都有一个子文件夹,名为其唯一ID号,其中包含其图像。1问题:上载的图像不可见。请查看链接已失效。