-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change content-disposition to attachment #50
Comments
If you're using the download output class, it's already implemented like you suggested: https://github.com/spiritix/php-chrome-html2pdf/blob/master/src/Spiritix/Html2Pdf/Output/DownloadOutput.php#L52 |
Yes I am aware of that but the problem is, when using that one, the file is downloaded automatically. |
Now when the user wants to download it the Chrome browser says it's downloading index.php instead of the PDF |
Okay I see. The issue is that the RFC states:
I don't see a way to use 'attachment' and still embed the file in the browser. Do you have an idea how to do that? |
I think we need to look for a way to be able to use "inline" and somehow get the filename download to work correctly. I'll investigate more and when I have some clear results we can check the solution |
I think the browser automatically uses the file name as in the URL. So in case of www.example.com/pdf.php it will be pdf.php. You could use rewrite rules to redirect a filename like /MyFile.pdf?id=1000 to /pdf.php?id=1000, that should work. Leaving this issue open in case anybody has an idea on how to solve this in the backend. |
Is it possible to change it from inline to attachment?
We encountered an issue when downloading and according to https://stackoverflow.com/questions/11432538/file-download-in-chrome-appears-incorrect-file-name-pagename-aspx-it-worked-b inline is not supported
The text was updated successfully, but these errors were encountered: