Comments (5)
@nkuehn Thanks for your issue report.
I tested shell with curl command.
curl -o test.pdf http://localhost:3000/\?url\=google.co.kr\&type\=pdf
It works.
And it worked well on the Chrome browser.
In addition, I added content-length
into response header
from puppeteer-renderer.
wow, that was fast. Looks like I primarily forgot to properly encode the URL.
but the content-length seems to have an issue in Firefox - curl finishes fine, but when I enter "http://localhost:3000/?url=google.co.kr&type=pdf" in chrome the download is stuck at "128kb of 135kb". The file curl wrote has 137954 bytes which is the "135kb" Firefox is showing.
If I look into the downloads folder the .part
file Firefox writes into is already there completely and has the full 135kb that contain a valid PDF I can open. But it's just not completing the process.
Chrome and Safari both happily display the PDF, but not Firefox. Can't really tell why though. I don't think it requires a Content-Disposition header (that would just help being able to control the filename that is saved on disk as far as I know).
Here's somebody with a similarly sounding problem but no real learning: https://stackoverflow.com/questions/34684919/how-do-i-get-firefox-to-complete-a-download-sent-from-restify-nodejs
from puppeteer-renderer.
I tested again via curl, chrome, firefox.
It worked well.
.part file was not created in download directory, and file size was the same as the size specified in the header.
So it seems to be firefox browser issue.
Thanks for your comment.
from puppeteer-renderer.
thanks for testing again - I'll dig into what could be the difference on my machine myself then.
from puppeteer-renderer.
PS: I got firefox to behave reliable by setting the content-disposition header to make it a download and set the PDF filename. It has an effect on chrome, too - will download then instead of directly showing the PDF. I'll send a PR in case you're interested in changing to that behavior
from puppeteer-renderer.
Related Issues (20)
- Is there a way to reduce the size of the docker container? HOT 1
- Add health check endpoint HOT 1
- Docker container fails to run HOT 1
- UnhandledPromiseRejectionWarning: Error: Page crashed! HOT 2
- How to pass additional options for clipping HOT 6
- Error 500 HOT 5
- Render started to act as proxy HOT 1
- Puppeter cache disable or clear HOT 1
- Expected options.clip.x to be a number but found undefined HOT 2
- animationTimeout shouldn't cause exceptions with fullPage (before the timeout passes, at least) HOT 5
- Custom DNS servers HOT 1
- what if url contains more than one parameter?
- Zombie chromium processes HOT 1
- Authentication HOT 1
- Inclusion of iframes in rendered output HOT 8
- Multi-Architecture Images (amd64/arm64) HOT 3
- Allow using POST method to allow for more/larger/longer options to be sent HOT 1
- Cannot find module 'fs/promises' HOT 1
- 建议更换一个镜像仓库吧,ghcr.io在阿里云服务器上pull一天了,愣是没pull下来。 HOT 1
- [CVE-2024-36527] Path Traversal Issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppeteer-renderer.