PDF file starts downloading - pdf

I am giving a link to a pdf file but it starts downloading the file instead of opening it
Complains

It could be that you don't have a pdf reader plugin installed on your browser.

Related

How to open the .docx file or .xls using react-native-file-viewer?

I want to know how to open the .docx file or .xls file using react native file viewer in android.I am using RNFetchblob todownload the file.PDF and Image files are getting opened.While am trying to open .docx file or .xls file using react native file viewer am getting the error like no app is found to open this mime type
You need to install a pdf viewer in your emulator or mobile.
Then you can open the docs. See Reference

Firefox removes extension on files when specific download folder is set on options

I'm having a problem downloading files on Firefox 62.0.2 (64-bit) or Firefox Developer Edition 63.0b9 (64-bit). On Internet Explorer works fine.
I've an admin panel with two buttons to download PDF's. When I click the buttons download pop-up shows and tell me to open the file or save it (and recognize the file as a PDF file). If I choose to open it it opens, but if I've set in the options to save the files on a specific folder, the file is saved with no extension. But if I've set on the options to specify the folder to download everytime, the file it's saved with the extension.
Here you can see the pop-up when it opens:
Then, If I've set on options download always to a specific folder:
But if I've set on the options to specify a folder everytime I download a file:
The file it's saved with the extension. On the code I've set the headers:
response.setHeader("Content-Type:", "application/pdf");
response.setHeader("Content-Disposition", "attachment; filename=\"desglose.pdf\"");
The URL to access to this resource it's:
#GetMapping(value = "/{id}/desglose")
#Secured(AuthoritiesConstants.ADMIN)
And after read this link Firefox cuts extension on files I don't know where it's my mistake. What I'm doing wrong?
Regards.
Ok, while reading the code after had copied here the lines, I noticed that after the function in other class there was a line with:
response.setHeader("Content-Disposition", "attachment");
which was overriding the value:
response.setHeader("Content-Disposition", "attachment; filename=\"desglose.pdf\"");
and was causing the problem. After remove the line response.setHeader("Content-Disposition", "attachment"); the downloads work fine.
Regards!

Where pdf files are saved when opened in browser?

I have few questions:
Where pdf files are saved when opened in browser?
Is it possible when i open pdf in Chrome, access that file somewhere
in my pc system?
They are stored at this path %USERPROFILE%\AppData\Local\ in Windows. Run this command %TEMP% in the run dialog box to visit the folder.

Load PDF in Vaadin from Resource

I designed a Document Viewer in Vaadin that displays PDF files to the user. I successfully added the PDF to the viewer by specifying the system path. The problem is when I run the Viewer in a remote system, the PDF isn't displayed. So is there any way to load the PDF using the resource like we load the images.
Here is my code:
File pdfFile = new java.io.File ("D:/WorkFiles/PDF Books/newsletter.pdf");
The pdf is loading only from the local system. I have tried adding the pdf in the themes folder, but it doesn't work.
Thanks in advance.
What about the https://vaadin.com/api/com/vaadin/server/StreamResource.html. You can use this for on demand generated PDF files.

.xlsx downloading issue

I have generated .xlsx reports on server, and page with direct links to these reports.
When user clicks a link, report file is downloaded, but file extension is changed to .xls.
Therefore, I can't open file correctly, only after changing of extension.
Problem occurs in IE, Firefox correctly downloads file, and Chrome saves file with name "File.xlsx.xls"
What can cause such behaviour? Any help appreciated.
Problem fixed with setting of mime-type "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" for .xlsx files