The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> pointing to content in folder, pointing to content in folder
mortenvilfredberg@me.com
post Jan 30 2020, 08:11 AM
Post #1





Group: Members
Posts: 2
Joined: 30-January 20
Member No.: 27,143



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....
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jan 30 2020, 08:50 AM
Post #2


.
********

Group: WDG Moderators
Posts: 8,295
Joined: 10-August 06
Member No.: 7



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.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
mortenvilfredberg@me.com
post Jan 30 2020, 10:10 AM
Post #3





Group: Members
Posts: 2
Joined: 30-January 20
Member No.: 27,143



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jan 30 2020, 04:07 PM
Post #4


.
********

Group: WDG Moderators
Posts: 8,295
Joined: 10-August 06
Member No.: 7



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-...-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).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 16th February 2020 - 04:20 PM