Directory Tree --> HTML

I asked the question once before but I did not make my question plain enough. So, again…

I have a list of files on several CD-ROMs and a DVD that I would like to make available for my customers to download from my website. I already have a directory that is password protected.

My next step is to, using the public library computer, put a CD-ROM into the drive and have a program read the drive and produce an HTML file listing those files. I’ll name the file /password protected directory/index.html. I may have to tweak this file somewhat but that can be done using Wordpad’s search and replace function and saving as text then renaming .html.

Now the biggest obstacle is that using public computers I am not allowed to install software. However I have a USB 1G drive, so the program must be self standing.

I’ve tried a bat file with command.com but it won’t allow the use of long filenames and the admin has disabled cmd.com so using cd, dir, and tree are out.

I’m starting my search over again, a little more systematically keeping copies of the names of programs that don’t work.

So, anyone know of a stand alone program that will read a drive and produce an html file listing the files with size and parent directory?

re-read your post. Since cmd is disabled, you cant do this:

dir . > output.htm

Access Denied.

Can one evoke a cmd shell within a command shell?

No, just a longer error message. But I’ll try on another computer. There is no consistency in the setup of Windows.

Didn’t you get my PM?

On my machine, I can run cmd from command from cmd, if that helps at all.

Is the Access Denied when you’re running the local command/cmd.com on the library computer? Have you tried putting cmd.com on your USB stick and running it from there? Forgive me if this is a stupid idea for some reason; it’s been a long time since I had to do very much from the Windows command prompt.

This may be totally against the library’s usage policy, but how about some kind of Linux live boot from CD or USB?

Missed the edit window:

Your ISP has settings that will allow this without your having to run any scripts. Check your message box, where I sent you instructions on how to do this.

Now that I’ve read your other thread, if I understand what it is you’re trying to accomplish (and I’m not sure I do), I think you got the answers over there. As mentioned in that other thread, can’t you get your web host to turn on auto-indexing for your website? Or, if you can use .htaccess files for password protection, maybe you can turn on auto-indexing in the .htaccess file (assuming the autoindex module is loaded, which I bet it is).

On preview, it looks like Terminus Est is on the case, and it sounds like (s)he and I are thinking the same way.

Terminus Est, found your message. htaccess is disabled but strangely enough is that I have a password protected directory with a Netfirms generated .htaccess file.

MrSquishy Auto-Indexing? Is there where someone goes to Domain.com Community Directory and their browser lists the files in that directory. If so, is there a command in the htaccess file that would allow this for only one directory?

Hmm, even though I use my website as backup for my USB drive I could backup in another, my own, password protected directory… Hmm, and that would make my Poison Spammers File public too.

Anyway, this sounds, if I understand correctly, like the best solution. If a customer could go to a directory and see all the files themselves would save me a lot of work and with only an hour a day allowed on the library computer a quick solution.

Times up. Gotta go. Check in Friday, Thursday is Monday Night Football day.

I haven’t worked with Linux Web servers in a long time…but can’t he use CHMOD via FTP to change the directory to browseable? (777 I think?)

Or am I remembering something from Computing 1982?

Httpd has a hierarchical permissions system layered on top of the Unix filesystem. Merely changing directory permissions would not be sufficient.

Yes, you need to enable it via the procedure given by your ISP.

Yes and yes. You specify the directory in the htaccess file.

chmod doesn’t work via FTP. You need shell access to do that. In any event, you still need to get the webserver to agree to display a directory listing.

Both ftp and sftp allow the user to change file permissions if they are connected as the owner of that file.

Ah, you are correct - although chmod capability is dependent on the ftp client. Modern *nix clients allow you to do this. Windows clients, not so much.

I dunno, I just checked in my CoreFTP app (a free FTP client for Windows) and I can connect to a remote location and right-click on a folder or file then choose “properties” and set perms there.

Now that I think about it, you have to be able to do this when you do things like set up Wordpress or vBulletin, so I would assume this is a standard feature.

And furthermore, since it works with Wordpress and vBulletin (for write perms, at least), no matter how deep the directories are, one would think that the hierarchy is inferred when setting up “browse” options. But that’s just a guess.

It wouldn’t hurt for him to try.

I’m not sure what S/FTP has to do with this. I think Will Repair is looking for an HTTP solution, judging from his mention of HTML files.

For the following, I’m assuming based on what I’ve read so far that your web server is Apache-powered. If you’re using IIS, I can’t help you (or maybe I should say “God help you”).

If .htaccess files are allowed on your web server, I think you’re in business. If you are already doing something (your authentication stuff?) via an .htaccess file, you’re good to go. If they’re not, they can be enabled with AllowOverride in a <Directory> context. If you can’t modify the Apache config for your virtual host, and AllowOverride isn’t set, you might be out of luck unless you can get your web hosting company to turn it on for you.

(Here is some documentation that might help with .htaccess file concepts)

Once you’ve got .htaccess files working, all you need to do is add this to the .htaccess where you have your authentication mechanism set up (presumably in the directory you’ve password-protected):


Options +Indexes

Described here, “+Indexes” will enable indexes:

I believe that is exactly what you want, assuming I’m understanding the question correctly.

If there is already an “Options” directive with other options, just tack a space and then “+Indexes” on the end.

There is a bunch of fancy advanced stuff you can do if mod_autoindex is loaded in Apache. Here is the documentation for mod_autoindex. Even if mod_autoindex isn’t loaded, though, I think all of the above still applies (I didn’t realize in my earlier response when I was talking about autoindexes that “Options +Indexes” is a core feature, i.e. doesn’t require any other modules).

I hope this helps.

You guys seem to be going way over technical for something that seems pretty straightforward.

He wants a text list of the files on his CD collection to add to his webpage.

No, he wants a list of files so people can download them from his webpage. This is pretty straightforward, but requires cooperation from the web server. I have already responded via PM, with appropriate links to the support pages of the OP’s web hosting provider.

But he wants to do this from a library terminal, keeping the files on CD. That sounds like a really bad way to even start.

In my case it’s the only way to start. I don’t have my own computer (well until the parts come in for a Judge Dredd and I swap a pinball overhaul for a laptop.)

Thanks to everyone for the help. It’ll take some time but I plan to try editing the .htaccess file to do what I want. It’ll take take time because I only have an hour a day I can use the library computer.

Wait a minute, these files are still on CD? The first step is to actually put them on the server.