Trying to download PDF file but Failed to load PDF
Closed this issue · 2 comments
theromie commented
I try to download the file in react using Axios but it failing in both conditions.
add
{ responseType: 'blob' }
to Axios and addedfileDownload(res.data, fileName);
but it gives Failed to load PDF document.
Removed
{ responseType: 'blob' }
to Axios and addedfileDownload(res.data.body, fileName);
but its gives blank file with no content.
I am using Nodejs as backend with sending response infs.createReadStream()
andpipe()
kindrowboat commented
Hey @theromie. Could you post a small repo that reproduces the problem?
theromie commented
@motevets I solve this issue. It was some error in the backend.