Forum list » General discussion »
File property - opening PDF files directly in the browser
Pages:  1
(36 posts)

File property - opening PDF files directly in the browser

Hi devs!

I have a property of type File. In the Content part I upload a pdf file to that property. When I create a link to that file (simply from model.MyFileProperty.GetUrl) I get a url to that file which is correct. However I can't seem to make the browser open the pdf directly. The content type is set properly by the cms (application/pdf). I wonder if it can be caused by the extension of the file (or actually missing extension, because the generated url does not have any extension). Is there any way to alter the file's URL to check if the extension is the problem? Any other advices on opening the PDF within the browser?

Cheers,

 

(104 posts)

Re:File property - opening PDF files directly in the browser

Hi, will adding &attach=0 or &attach=1 to the file url help?...

(36 posts)

Re:File property - opening PDF files directly in the browser

Hi Ole!

Yes, attach=0 helped me. Thanks!