I receive file url as response from api. when user clicks on download button, the file should be downloaded without opening file preview in a new tab. How to achieve this in
You can use FileSaver.js to achieve this goal:
const saveFile = () => { fileSaver.saveAs( process.env.REACT_APP_CLIENT_URL + "/resources/cv.pdf", "MyCV.pdf" );
};
Download File