Open folders with htm link

Good day

Recently I designed a html page which I host from my main PC using WAMP.

When I am on the web page on the local machine and I click on one link it opens a folder ( File explorer) displaying all images inside that folder, which is perfectly fine.

However, when accessing this web page from my laptop, and I click on the same link nothing happens.

I tried several remedies which include putting both computers on a home group. Sharing the specific folder etc.

Basically what I’m trying to do is to open the folder containing the images from a “client” PC.

I know there is simpler ways but I need this to work from my website, almost like a local intranet where every PC connected on my network will be able to access these images from their own computer using my localhost web page.

Kind regards
Ashleigh

Laptop screens are smaller than desktop ones, so the page elements may have shifted a bit so that one is overlapping the link, making it inaccessible. Do you get the pointer mouse icon when you mouse over the link on your laptop?

No the webpage loads fine.

The problem is that nothing happens when I click the link on the client side. I read something about unc paths but it is still not working.

I want the file explorer to open on client side displaying images in that folder that is on the server side.

Opening a folder from the OS and opening from a browser HTTP request are entirely different things. The OS explorer does a lot “auto-magically” like displaying the filenames, icons, file sizes, modification dates etc.

One thing you can easily do is place an htaccess file in the folder with:
Options Indexes
so that when requests for that folder that aren’t requesting files within it are made Apache will display an “index” page listing the files that are in the folder.

AFAIK, if you want to have more information than that the browser will need to get HTML with the information in it.

Assuming the server is set up to look for an “index.php” file when no file within a folder is requested, you could write PHP script to get different information and then display it. But other than the Apache “indexes” page there is no “automatic” way of displaying folder contents as an HTTP response the same as they would be displayed in the OS explorer.

I do get the “client” pc to display the list of contents in the specific folder.

I was wondering is their no way to launch the file explorer to display the actual contents when clicking on the link as to displaying only the list when visiting page from the client side.

I’m asking because it is interesting that when I visit this page on the localhost pc, and I click on the link, it displays the actual contents of the folder with the OS file explorer and not a list view of the contents

There might be a way to open up the OS filesystem to external requests. But because it would be a major security risk it is not something I would want to do.

As I posted before, if you want to display more than a simple list you could write a script to display information about files within a folder and have the script output an HTML page.

There is always WebDav which allows client to view the contents of a server. I’ve never tried to set it up myself, but it’s probably not very easy.

Writing a script that finds all files on your server and displays them on a website as @mittineague suggests would be a lot easier, and less error prone with less security risks.

Good day

I did a bit of research, when you guys mentioned about a script and to put it in an html page.

There is actually a very simple way using php, its working great also.

Thank you for your input and advise

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.