Developer forum

Forum » CMS - Standard features » Allow PDFs to be viewed in the browser

Allow PDFs to be viewed in the browser

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

 

I have an Ecommerce template with code like this:

 

 <a href="/Files/Files/ProductSpecSheets/<!--@Ecom:Product.Number-->.pdf"><i class="fa fa-file-text"></i> Spec Sheet (PDF)</a>

 

However, when rendered in the browser the path is changed to:

 

<a href="/Admin/Public/DWSDownload.aspx?File=%2fFiles%2fFiles%2fProductSpecSheets%2fW4120.pdf"><i class="fa fa-file-text"></i> Spec Sheet (PDF)</a>

 

Note the inclusion of the DWSDownload.aspx file. This in turn forces the browser to show the Save As dialog for the PDF document.

 

Is there any way to prevent this from happening?

Imar


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Bump..... Any way to accomplish this?

 

Imar

 
Lars Sørensen
Reply

Store the PDFs in the Images folder instead. Doing so should force DwsDownload to open it instead of downloading it. At least, it used to be like that in the old days;-)

Br.

Lars

 

 
Nicolai Høeg Pedersen
Reply

You can change your link to this:

 

<a href="/Admin/Public/Download.aspx?File=/Files/Files/ProductSpecSheets/<!--@Ecom:Product.Number-->.pdf&download=false"

BR Nicolai

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Cool, thanks.

 

One more thing: how can I do that when generating a PDF using PDF=True? I tried adding it to the query string but I still get a Save As dialog....

 

Imar

 

You must be logged in to post in the forum