Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ pointing to content in folder

Posted by: mortenvilfredberg@me.com Jan 30 2020, 08:11 AM

Is there anyway to pointing to content in a folder.

If want an Iframe to show a PDF file in a specific folder. I want to just swap the file, not changing the name in the link ?

Thanks....

Posted by: Christian J Jan 30 2020, 08:50 AM

QUOTE(mortenvilfredberg@me.com @ Jan 30 2020, 02:11 PM) *

If want an Iframe to show a PDF file in a specific folder.

If PDF is shown in web pages may depend on the browser. It's best to provide a direct link, at least as a fallback.

QUOTE
I want to just swap the file, not changing the name in the link ?

If the new file has the same name as the old one, you could just swap the file. You may want to prevent return visitors' browsers from displaying their previously cached version, though.

If the new file has a different file name you need server-side scripting (like PHP) to find it and generate the correct URL in the link and iframe.


Posted by: mortenvilfredberg@me.com Jan 30 2020, 10:10 AM

OK, I hoped a wildcart-character of some sorts could do the trick.
I do not want to have same filename. Because of cache and of course reference to original file.

Thanks

Posted by: Christian J Jan 30 2020, 04:07 PM

Here's another idea, at least for links (so it may not work with PDF in an iframe). This page explains how to apply CSS to Apache's directory listings: https://perishablepress.com/better-default-directory-views-with-htaccess/ (a bit down the article).

Since Apache can generate HTML links to files, you might use CSS to hide all but one. Assuming the first five links are used for sorting by Name, Last Modified etc; and the first real PDF link is the 6th in total, you might single it out with:

CODE
a {display: none;}
a:nth-child(6) {display: inline;}

Of course the PDF files must also be named so that Apache sorts them with the latest in a predictable place (at the top or bottom).

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)