previewAttachment = (event, file) => {
event.preventDefault();
let reader = new FileReader();
reader.readAsDataURL(file);
setTimeout(() => {
window.open(reader.result,"_self");
}, 500);
};
The above code opens a file in Firefox and other Browsers, where as in google-chrome it downloads the file instead of opening it.