2

We had published the pdf file into Tridion database with certain Publication Id, Binary Id, Variant Id and Path.

Can I know, how do I load the pdf directly using the below url.

http://www.newexamplesite.com/personal/documents/pdf/bank-accounts/US_ForecastUpdate2016.pdf

4

A pdf is also a multimedia item except it doesn't render on any page like images. If you place url of any pdf on any link or anchor tag, on link click it will automatically download that pdf file. DXA cache these files inside media folder of BinaryData folder of corresponding publication.

I believe you have published pdf components at structure group path personal/documents/pdf/bank-accounts. I haven't tried it with variant ID. Is it showing any error in browsing this file directly in browser?

3

DXA assumes that Binaries (Media Items) are published under the "Multimedia URL" as configured on the CM Publication.

This will happen if you publish the Binaries without specifying a StructureGroup. You could also create StructureGroups which reflect the MultimediaUrl and publish your Binaries in that SG subtree.

Anyways, DXA assumes that the URL of Binaries start with the configured MultimediaUrl. The reason for this is that it has to distinguish so-called Static Content Items (handled by the StaticContentModule) from dynamic Pages or REST API request (handled by a Controller).

  • Hi Rick, We had created a separate documents structure group where the pdf files are placed. What I see for images, we can set the path in tridion. – Suresh Jan 18 '17 at 21:19
  • Multimedia URL can be used for setting only path which we are already using for Images. For pdfs, we want to have different path like /document. DXA is able to recognize images since it is configured in image path in publication properties. DXA is not able to recognize pdf's and it is searching for views and redirecting to 404 page. How DXA can recognize custom asset folder /documents/. – Suresh Jan 18 '17 at 21:22
  • That is correct; DXA assumes that all Static Content Items are in a single URL subtree. Would it be a problem to use, say /media/images and /media/documents ? – Rick Pannekoek Jan 19 '17 at 18:17
  • Hi Rick, As per the direction we were asked to have as /documents only. Is there anyway we can achieve this. – Suresh Jan 23 '17 at 17:35
  • You would have to change the implementation of class Localization (part of the DXA Framework) so it can use multiple regular expressions to detect Static Content Items. See github.com/sdl/dxa-web-application-dotnet/blob/master/… – Rick Pannekoek Jan 23 '17 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.