I have a form that, upon submission, should redirect and display a PDF from my media library. Upon submission, I am receiving this error:
Does Sitecore 9 Forms require that I provide a layout file for presenting PDFs?
Sitecore Stack Exchange is a question and answer site for developers and end users of the Sitecore CMS and multichannel marketing software. It only takes a minute to sign up.
Sign up to join this communityIn order to have the proper url for the .pdf
, you need to use the method GetMediaUrl
.
This will generates the url in the proper way. Moreover, you can check the following answer on how to open or display the pdf on the browser.
.pdf
because Sitecore thinks it is an item with a layout that you want to render. Use theGetMediaUrl()
to generate the url for the pdf and then perform the redirection