Reporting

how to open pdf/word document in new tab

DataOrg
Builder

i have a pdf/word file in splunk server. i want to open the file in new tab when a user clicks the link.i tried with HTML and it was not working.

<a href="h:/helpfile/newdocument/document.pdf" target="_blank">help with data</a>
0 Karma

bmunson_splunk
Splunk Employee
Splunk Employee

The url you give in your question prompts the browser to look for that file on the users h drive and not on the splunk server. For security reasons you can not just point to any folder on the splunk server.

There is a way round this by uploading a file inside an app and then using its correct link. Let's say you have created an app called documentation. Go to manage apps> Click Edit Properties for your app. Upload your file with Upload assetand save

Once it is there, you can link to it with. "/static/app/documentation/MyFile.pdf" so you can make your html..

<a href="/static/app/documentation/MyFile.pdf" target="_blank">help with data</a>
0 Karma

Yogesh
New Member

After uploading pdf with blow mentioned steps  pdf got saved to folder  etc\apps\Myapp\appserver\static  folder.

But in this case /static/app/Myapp/MyFile.pdf  is not working . 

Can you please tell me what may be wrong  ?

 

 

 

 

0 Karma

niketn
Legend

@premranjithj can it be uploaded to your Splunk app's appserver/static folder?
Sample path like below:

$SPLUNK_HOME/etc/apps/yourAppName/appserver/static/helpfile/newdocument/document.pdf

If not, by default browser will not allow you to load local resources as it will expose malicious activity, you will have to host Help pdf file on a server and anchor should point to that http/https URL.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

PavelP
Motivator

does it open in the same tab or doesn't work at all?

BTW the link is broken: h:/helpfile/newdocument/document.pdf

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...