I am having trouble viewing uploaded files in the carousel. While I can see video and image files, other document formats are not displaying. Can someone please recommend a solution to enable viewing all types of documents as well?
mydata = []
onSelectFile(event) {
const files = event.target.files;
if (files) {
for (const file of files) {
const reader = new FileReader();
reader.onload = (e: any) => {
if (file.type.indexOf("image") > -1) {
this.mydata.push({
url:e.target.result,
type: 'img'
});
} else if (file.type.indexOf("video") > -1) {
this.mydata.push({
url:e.target.result,
type: 'video'
});
}else if (file.type.indexOf("ppt") > -1) {
this.mydata.push({
url:e.target.result,
type: 'ppt'
});
}
};
reader.readAsDataURL(file);
}
}
}