BlueImp使用一个名为.htaccess的文件,其中有一个文件;
ForceType application/octet-stream
<FilesMatch "(?i)\.(gif|jpe?g|png)$">
ForceType none
</FilesMatch> 有谁知道如何改变这种情况,以便我只能选择.csv文件吗?
无论我更改了什么,文件对话框;
<input id="file" type="file" name="files[]" multiple accept=".csv">总是显示“所有文件”,"html文件“和”图像文件“。
编辑
在进一步检查时,不需要.htaccess文件。IIS不正确地报告了这一点。
问题在一些备选方案中;
// The regular expression for allowed file types, matches
// against either file type or file name:
acceptFileTypes: /.+$/i,
// The regular expression to define for which files a preview
// image is shown, matched against the file type:
previewFileTypes: /^image\/(gif|jpeg|png)$/,我似乎想不出如何修改上面的内容来获得.csv文件的列表。
发布于 2013-04-26 04:13:29
.htaccess文件由Apache服务器使用,可能与您的HTML文件问题无关,因为它们控制对服务器的传入请求。
在HTML中尝试以下标记:
<input id="file" type="file" name="files[]" multiple accept="text/csv">"text/ CSV“是CSV文件的MIME类型,accept采用MIME类型,而不是文件扩展名。
https://stackoverflow.com/questions/16228613
复制相似问题