Skip to content
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

Image not showing when uploaded on vps server #691

Open
MohsinUddinAbir opened this issue Aug 13, 2022 · 0 comments
Open

Image not showing when uploaded on vps server #691

MohsinUddinAbir opened this issue Aug 13, 2022 · 0 comments

Comments

@MohsinUddinAbir
Copy link

When downloading as pdf on localhost image shows fine but when downloading from VPS Ubuntu server image does not show, instead showing a squire box.

ejs
  .renderFile(path.join(__dirname, "../../utils/invoice.ejs"), {})
  .then((html) => {
     let options = {
        httpHeaders: { "content-type": "application/pdf" },
        orientation: "portrait",
        type: "pdf",
        format: "A4",
     };

     pdf.create(html, options).toStream(function (err, stream) {
        stream.pipe(res);
        return;
     });
  })
})
// invoice.ejs
<div class="col">
  <div class="invoice">
     <img src="https://masterfileservice.com/storage/logo.png" /> 
     <!-- Problem here, image showing on localhost but not showing on VPS Ubuntu server -->
  </div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant