• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Hyperlink display files listed in a folder if Edge is used as the browser

New Here ,
Jun 18, 2020 Jun 18, 2020

Copy link to clipboard

Copied

Hyperlink display files listed in a folder if Edge is used as the browser. We created and internal website for sales to display customer testomonials. Chrome displays correctly but Edge browser does not. Is there something I can do in dreamerweaver to allow the display of the page? Click on link screen flashes and disapears. Trying to avoid creating each link manually. Current:

<a href="pdfs/CaseStudies_Testimonials/Wire/"><img src="../images/icon-wire.png" width="133" height="149" alt="Wire"/></a>

TOPICS
Browser , Code , How to

Views

178

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2020 Jun 18, 2020

Copy link to clipboard

Copied

Right now, your link is going to a folder and not to a specific page. Chrome may actually be displaying incorrectly in this case.

If you want a specific page to show when the link is clicked, and your server isn't forcing directory browsing to go to specific pages, you'll need to add it to the href. For example...

pdfs/CaseStudies_Testimonials/Wire/index.html
or
pdfs/CaseStudies_Testimonials/Wire/thepdflist.html

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2020 Jun 18, 2020

Copy link to clipboard

Copied

What kind of server is this?

 

If this is a *nix server, then you could disable indexes using the following in an htaccess file:

 

Options -Indexes

 

However, the larger problem here is that your index file isn't being seen as a default.  If you don't want to use an index file in that folder which are the system defaults, you can also add to that file this line to tell the system what file to direct someone to:

 

DirectoryIndex myfile.html

 

If you are using IIS, just post back and we can provide some direction on that as well.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2020 Jun 18, 2020

Copy link to clipboard

Copied

LATEST

If your server supports PHP scripts, it's easy to show contents of select folders without compromising your server's security.   See below for details.

 

Show folder contents with PHP code.Show folder contents with PHP code.

 

1. Copy and paste code below into a new blank document. 

2. Change 'pdfs/2016/' path to location of your content.  Repeat with other folders.

3. Save page as test.php and upload to your remote server.

 

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Get files from folders with PHP</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<?php
class SortingIterator implements IteratorAggregate
{
private $iterator = null;
public function __construct(Traversable $iterator, $callback)
{
if (!is_callable($callback)) {
throw new InvalidArgumentException('Given callback is not callable!');
}
$array = iterator_to_array($iterator);
usort($array, $callback);
$this->iterator = new ArrayIterator($array);
}
public function getIterator()
{
return $this->iterator;
}
}
?>
<!--results-->
<section>
<h3>PDFs from 2016</h3>
<ul class="archive">
<?php
function mysort($a, $b)
{
return $a->getPathname() > $b->getPathname();
}
$item = new SortingIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator('pdfs/2016/',RecursiveDirectoryIterator::SKIP_DOTS)), 'mysort');
foreach ($item as $file) {
	 if ($file != "." && $file != "..")
echo '<li><a href="' . $file . '">' . $file->getFilename() . '</a> - '. round( $file->getSize() / 1052) . '  KB </li>';
}
?>
</ul>
<h3>PDFs from 2015</h3>
<ul class="archive">
<?php
$item = new SortingIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator('pdfs/2015/',RecursiveDirectoryIterator::SKIP_DOTS)), 'mysort');
foreach ($item as $file) {
	 if ($file != "." && $file != "..")
echo '<li><a href="' . $file . '">' . $file->getFilename() . '</a> - '. round( $file->getSize() / 1052) . '  KB </li>';
}
?>
</ul>
<h3>PDFs from 2014</h3>
<ul class="archive">
<?php
$item = new SortingIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator('pdfs/2014/',RecursiveDirectoryIterator::SKIP_DOTS)), 'mysort');
foreach ($item as $file) {
echo '<li><a href="' . $file . '">' . $file->getFilename() . '</a> - '. round( $file->getSize() / 1052) . '  KB </li>';
}
?>
</ul>
</section>
</body>
</html>

 

Post back if you have any questions.

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines