In my project I use file-saver to download files. When the file is in blob format, downloading acts as expected (i.e. starts downloading file, without opening new tab), however if I use URL as a parameter, new tab with the file is opened and downloading just doesn't start.
import {saveAs} from 'file-saver'
const saveFile = async (file) => {
try {
saveAs(file.url, file.name);
} catch (error) {
console.error(error);
}
};
Is there any way to download file by providing URL, without opening new tab? If not, how can I make this download start in this new tab? I can't use blob in this situation.