Display a pdf file in mashup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Display a pdf file in mashup
hi,
I want to display a pdf file in a mashup (webframe), I Set the good url, but the problem is that when i click on a grid i download the pdf file instead of display it in a webframe.
help please.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @anassNasser ,
The browser's behavior is determined by Content-Disposition HTTP header, see details here: https://stackoverflow.com/questions/6293893/how-do-i-force-files-to-open-in-the-browser-instead-of-downloading-pdf
Depending on how your ThingWorx is hosted, you'll have different options of configuring it. For exampl, if you have Nginx reverse proxy in front of your ThingWorx, then this config will make PDFs render inside browser instead of making it downloading them:
location ~* /(.*\.pdf) {
proxy_hide_header Content-Disposition;
add_header Content-Disposition "inline";
... the rest of redirect config ...
}
Regards,
Constantine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I think that is tied to the browser behavior.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Okey I will test it in different browsers
- Tags:
- design
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @anassNasser.
How did your testing go? If you found that the issue was tied to browser behavior, please mark the response by @PaiChung as the Accepted Solution for the benefit of others on the community.
Regards.
--Sharon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I tested in Google Chrome, Mozilla firefox but i can't bind my service with URL Variable of webframe, but when I Call the mentionned in documentation I Can get my file in browser (but no result when i bind it )
https://colligodemo2.cristalcloud.com/Thingworx/FileRepositoryDownloader?download-repository=NomDuRepertoireLocal&directRender=true&download-path=/NomDuFichier.pdf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Since this seems to be in a Thingworx repository.
When you run the service GetFileListingWithLinks it should give you a usable URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @anassNasser ,
The browser's behavior is determined by Content-Disposition HTTP header, see details here: https://stackoverflow.com/questions/6293893/how-do-i-force-files-to-open-in-the-browser-instead-of-downloading-pdf
Depending on how your ThingWorx is hosted, you'll have different options of configuring it. For exampl, if you have Nginx reverse proxy in front of your ThingWorx, then this config will make PDFs render inside browser instead of making it downloading them:
location ~* /(.*\.pdf) {
proxy_hide_header Content-Disposition;
add_header Content-Disposition "inline";
... the rest of redirect config ...
}
Regards,
Constantine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @anassNasser.
If one of the previous responses allowed you to find a solution, please mark the appropriate one as the Accepted Solution for the benefit of others on the community. If you have found your own solution, please post it here and mark that as the Accepted Solution.
Regards.
--Sharon