I've got an app that is trying to make a "localized" version of the
JS Timeline that was developed by Northwestern University where localized means that data doesn't have to be sent to the cloud in order for timelineJS to use it. The app itself serves as an interactive builder for the timeline, which updates with each addition of an element. The full code is too much to post in this forum, but can be found
here.
My issue is this: In order to keep confidential information (files such as PDFs, sound files, images of suspects, etc) local, I do some behind the scenes checks about the files and if it needs to be local, I wrap it into an html file, which gets fed to the timeline, which gets wrapped in an iframe. When I try to do this with PDF documents, it coerces the HTML to include an iframe tag and it links the appropriate HTML file. The problem is that the nested file path, the one that links to the PDF document isn't being executed properly. It seems like no matter what I try, Shiny can't find the file.
Here's the code that's relevant to this process:
```
file_name <- file.path(...) # this is what I need to fix, I think
pdf_string <- paste('<object data = "', file_name, '" type = "application/pdf" height = "100%" width = "100%">',
'<p>It appears you don\'t have a PDF plugin for this browser.',
'<a href = "', file_name, '"> Click here to download the PDF file.</a></p></object>', sep = "")
write(pdf_string, file = "www/some_pdf.html")
```
When the HTML renders, it comes out like this:
```
<iframe src = "some_pdf.html">
<h1>Not found</h1>
</iframe>
```
Opening some_pdf.html outside of the shiny app works fine. So how do I leverage my file path inside of Shiny to get this to work?
Thanks!