I'm attempting to display both PDF and JPG files that are served from my backend to a new tab inside of the user's web browser. The code below works great for PDF files (opens them in new tabs and has adjustable sizing) but it automatically downloads the JPG files.
I've looked into embedding the images and making them fullscreen in a new tab as well as some react packages but I'm curious to see if there is a better way of doing this
openFile(file) {
var url = url/path/to/backend/request;
window.open(url, this.state.song.Title)
}
How can I force the JPG files to be displayed in a new tab like the PDF files are?