• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

How to view a directory in a web page

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

palee72

Member
Joined
Sep 10, 2002
Location
Pittsburgh, PA
Ok.. I'm just playing with this for something to do. I'm by no means a web programmer and my abilities are pretty much limited to web page design with MS Word...

I've got my web page set up with IIS and I can reach it from the web, no issues there. What I am trying to do is this..

I want a link from my Index.htm page (home page) which is on my C: drive to point to a drive on my server (E: ) which holds photos. I don't want to create a web page listing each picture, I have thousands. So what I want to do is simply show the directory listing of my E: drive with a link. Every time I try, I get either page not found errors, or it sits there and does nothing. I know I'm missing something simple. I don't want to have to move the entire directory to the wwwroot folder on the C: drive.

I have tried "sharing this folder to the web" and that didn't work either.

This is on a 2k3 server. Any suggestions are appreciated.

Thanks
 
Usually the path of the file you want to show via webserver needs to be below the webserver document root path. This is for security reasons so no one can e.g. read out your password file, love letters, browser cache, etc. on your disk.

Get a gallrey that automatically indexes your photo directories.

Hint: it's easier to go Apache, PHP and MySQL instead of IIS: the software for it like the gallery is cheaper (free).
 
You will need to use a scripting language and JavaScript is the most widely accepted by most browsers. This will require programming so you may need to read up on JavaScript using google searches for exactly what you need. More often then not someone out there needed to do the exact same thing you want to do and has posted thier methods.

The only other method of doing this that I know of is to open FTP access to your box through IIS. then you can use an FTP program or even IE itself by replacing http:// with ftp://.
 
Kill IIS.

INstall Apache, then set up a document root for ~images/ or some such which points to E:/Images/ Or whatever your directory is called.

IIS is just terrible software. Apache > IIS in every regard.
 
Thanks for the replies

That is pretty much the answer I got from some of my friends who do this kind of thing. At the moment, PHP and Apache is a bit much for what I want to do. I'm just doing this for basic access. I thought about setting up FTP and did have one set up at one time. Maybe I'll go that route since I don't need anything flashy and it is for my use only.

Thanks again everyone. I'll hit you up when I decide to learn PHP or apache.
 
apache doesnt have to be anymore than you want it to be... if you want to do apache, thats all you have to install, you dont need PHP as well. although i prefer a program called abyss web server, if all you want is one site, check out the free version of that program http://www.aprelium.com/ once installed, you have a webbased GUI to control everything, no need to go through and do manual configs...its all easy peasy
 
Why not change the root dir of the webserver to the E: and have all your photos in E:\photos and then you index.html in the E:\ and a link to the photos dir

that should do what you want

I do agree with everyone else though... IIS sucks, get apache and php. if you struggle to set apache up on your own, get XAMPP
 
Last edited:
Not sure what you do that it does not work. If you create a New Virtual Directory inside of your IIS root tree, Call it say, MyPix, point it to your E:\ drive root it should work np. Make sure that you give users Read & Browse permissions.
 
I think AtomicMonkey is on the right track. You may also need to to give permissions to that directory to the IUSR (Internet User) accounts. It has been a while, but I think those user accounts begin with IUSR.

Keep in mind, what you are doing might make your machine less secure.

You can also use the System.IO classes in ASP.NET or the Scripting.FileSystemObject in ASP to parse the directories and generate a simple HTML interface. When a link is click, use the classes to read and Response.Write the images. A few web searches will find the appropriate code.
 
I also suggest going with apache/php. If you're dead set against it, the simplest way would probably be to set up an ftp server. The best alternative would be asusradeon's idea: set the root to your e:\
 
Back