(moved from a closed topic to a new one)
Hi meredydd, I’m struggling with presenting/downloading a PDF that is base64 encoded. Here is what I have tried:
byte_string = doc_base64.encode()
my_media = anvil.BlobMedia(content_type="application/pdf", content=byte_string, name="hello.pdf")
self.link_notification.url = my_media
I know doc_base64 is valid because I’ve copied and pasted the raw value into an online converter and the PDF is correct. However, when I try the above, I always get an invalid PDF format when I try to open the downloaded file. Should I be handling this in a different manner?
Thanks in advance,
David