我正在尝试从FileList对象过滤或删除某些文件。我已经得到一个FileList对象形式的目录选择器。
<input type="file" accept="image/*" webkitdirectory directory multiple>
Run Code Online (Sandbox Code Playgroud)
在我的.ts文件中:
public fileChangeListener($event: any) {
let selectedFiles=$event.target.files; //Object of Filelist
}
Run Code Online (Sandbox Code Playgroud)
selectedFileList包含不同类型的文件,例如图像/ jpg,图像/ png,应用程序/ javascript,应用程序/ pdf等。我想获取仅包含图像类型文件的FileList对象。如何获取?
注意:HTML输入元素中的accept =“ image / *”在这里不起作用。
{
lastModified:1521624250148,
lastModifiedDate:Wed Mar 21 2018 15:24:10 GMT+0600 (+06) {},
name:"rxlnn70l.bmp",
size:814138,
type:"image/bmp",
webkitRelativePath:"second/rxlnn70l.bmp",
}
Run Code Online (Sandbox Code Playgroud)
在我的代码中 error: files.slice is not a function
我想在Amazon Linux 2中使用主管程序包管理器运行ASP.Net Core应用程序。执行以下命令以安装主管程序
$ sudo yum安装主管
它说:
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package supervisor available.
Error: Nothing to do
Run Code Online (Sandbox Code Playgroud)
操作系统细节:
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
Run Code Online (Sandbox Code Playgroud)
也尝试过
$sudo yum install epel-release
Run Code Online (Sandbox Code Playgroud)
同样的错误:
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package epel-release available.
Error: Nothing to do
Run Code Online (Sandbox Code Playgroud)