how to (need code for dynamic HTML)

Posted by: Whitey

how to (need code for dynamic HTML) - 04/05/2004 14:55

I'm getting ready to leave for my internship in North Africa in a few months. In the mean time I will be living in Shrevport, Louisiana for the summer. I have already sold most all of my possestions on Ebay so that I don't have to pay a crazy storage bill while I am gone. I need to have access to certian files from anywhere in the world I am, so I'm going to upload the critical info to my webspace.

I want to have a link in my site that will show all files in this space without having to code and recode everytime I add a file or change a file name. I would just put them into the FTP site, but I'm not always sure that I will be in front of a computer with an FTP client.

So, I am reasonably sure that this can be done, I just dont know how. I know I need to write something that scans the directory server side then writes code client side. other than that I dont know where to begin. This sounds like a PHP sort of thing, but I'm still new to all of this so I require a little (not much) hand feeding.
Thanks.......
Posted by: wfaulk

Re: how to (need code for dynamic HTML) - 04/05/2004 14:58

One, most (all?) browsers are ftp clients, if not particularly good ones.

Two, most (all?) web servers can generate directory listings.

Three, your bigger problem is probably how to add new data.
Posted by: tfabris

Re: how to (need code for dynamic HTML) - 04/05/2004 15:09

To expand upon what Bitt said...

If you don't set the web server to explicitly deny the permission to "browse" directory listings, then you can see the contents of a web subdirectory simply by surfing to the URL of that directory. No server side coding needed.

Depending on which web server software is used on that server, it might be controlled by a hidden configuration file you place in that folder, or it might be configured some other way on the server. You might have to ask your hosting provider how to enable directory browsing on your web site.

If you do this, however, make sure not to store a file in that folder called "index.htm" or "index.html" or "index.php" something like that. Because if you do, then the web server will display that file instead of the directory listing. (And by the way, which sets of file names are counted as index pages is also something that's configured on the web server.)
Posted by: Cybjorg

Re: how to (need code for dynamic HTML) - 04/05/2004 15:42

There are easy third party PHP scripts that will allow you to view the contents of a online folder, as well as upload a file without the need of an FTP client. This way, you can deny permissions to most folders while only the ones containing the PHP file are open to the public.
Posted by: wfaulk

Re: how to (need code for dynamic HTML) - 04/05/2004 16:25

You can also do that with most web servers out of the box. But whatever works for you.
Posted by: Whitey

Re: how to (need code for dynamic HTML) - 04/05/2004 19:26

Thanks for getting me straight fellas.
Posted by: wfaulk

Re: how to (need code for dynamic HTML) - 04/05/2004 19:37

If you let us know what kind of web server you're using, we can potentially offer more advice, assuming you need it. For example, under Apache, the relevant configuration options are "Options +Indexes", "DirectoryIndex", all the mod_autoindexing options, and the "<Directory>" limiter and/or the fact that you can put options in specific directories' .htaccess files.
Posted by: Whitey

Re: how to (need code for dynamic HTML) - 05/05/2004 05:29

I am using apache. I just tried the indexing function and it appears to be turned on. I think that will be the solution to my problem.

Now that I have that fixed....I am using Foxfire to download a few very big files, and It keeps writing them to the default C:\temp\whatever.exe and then writing it to it's final destination. The download is failing becasue I dont have enough room on that disk. Is there a way to force Foxfire to write to the final destination, or can I change the location of the temp files?

Seems like the questions never stop.

Posted by: RobotCaleb

Re: how to (need code for dynamic HTML) - 05/05/2004 09:56

perhaps you mean Firefox

and sorry, cant help with the temp issue
Posted by: tfabris

Re: how to (need code for dynamic HTML) - 05/05/2004 09:59

The location of the temporary folder is controlled by the operating system. If you are running Windows NT/2000/XP, that's an environment variable called TEMP. You set the environment variables in the system properties advanced tab.
Posted by: wfaulk

Re: how to (need code for dynamic HTML) - 05/05/2004 12:07

Can anyone explain to me the purpose of writing to a temporary directory and moving it instead of just writing it to the right place to begin with? I can't come up with any reasons and it causes a number of problems.
Posted by: wfaulk

Re: how to (need code for dynamic HTML) - 05/05/2004 12:16

According to what I've read, Mozilla just downloads to the temp directory while you're confirming the real save directory and filename and then immediately moves it over. Maybe that's not what happens under Firefox. Or maybe it's different if they're on different filesystems. Anyway, have you gotten to the point where you accept a filename?
Posted by: tfabris

Re: how to (need code for dynamic HTML) - 05/05/2004 12:41

Can anyone explain to me the purpose of writing to a temporary directory and moving it instead of just writing it to the right place to begin with?
Yes. Because Joe Sixpack might try to open the file before it's finished downloading all the way.
Posted by: wfaulk

Re: how to (need code for dynamic HTML) - 05/05/2004 13:00

And the downside of this would be... ?
Posted by: tfabris

Re: how to (need code for dynamic HTML) - 05/05/2004 13:10

Joe sixpack would (a) get an error message from whatever app he tried to open it with, or (b) possibly, depending on the application he opened it with, cause the file to become locked so that it can't be written to any more, thus preventing the browser from being able to continue the download.
Posted by: wfaulk

Re: how to (need code for dynamic HTML) - 05/05/2004 13:16

Oh, yeah. I forgot how fucked-up Windows' file locking is.
Posted by: Whitey

Re: how to (need code for dynamic HTML) - 05/05/2004 13:43

I did mean Firefox.

And thanks Tony. I knew there was something I could do about it.