Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

req.Assets doesn't take filenames with / in them (e.g. images/logo.png). #20

Open
titpetric opened this issue Apr 22, 2020 · 3 comments

Comments

@titpetric
Copy link

I am upgrading from the Go client from v6 to v7:

I wanted to add a glob("images/*") which i would then feed to req.Asset; the filename part of issuing gotenberg.NewDocumentFromPath would be images/logo.png.

If doing it like this, the rendering fails with "failed to generate the result PDF", and it works if I remove the images/ from the filename path. I suspect because the assets path should be created when adding it, and there's an os.Mkdir missing in gotenberg somewhere.

I am using the 6.2 docker image with this.

@gulien
Copy link
Contributor

gulien commented Apr 24, 2020

Hello @titpetric

Actually the filename should not be a path (aka images/logo.png) but the filename and its extension only (e.g logo.png). See https://thecodingmachine.github.io/gotenberg/#html.assets

@titpetric
Copy link
Author

Good enough, would love a panic or error somewhere if that happens, as it should be an easy check to do.

@titpetric titpetric reopened this Apr 24, 2020
@titpetric
Copy link
Author

Just reopening if this behaviour can be improved ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants