PDA

View Full Version : how to link to GIFs with changing names


RoySpencer
18-07-2003, 18:15/06:15PM
Sorry if this is a dumb question. If there are 10 GIF files on another web site in a known directory whose names change frequently (their time of creation become part of the name), is there a way within JS (or some other language) to link to them? Maybe somehow read the files names first? (They are on a government server that allows this, otherwise I know it would be considered "bandwidth theft"). Thanks!

qwerty
18-07-2003, 18:22/06:22PM
I'm no JavaScript guy, but I suppose that if you know the script they're running to generate the name of the file, you can run a similar script to create a URL based on it.

I have a question, though: if the gifs are the same and it's just their names that change, and you want to display the gifs all the time no matter what their file names are, why not just save a copy of them to your server?

polarmate
18-07-2003, 18:42/06:42PM
:hi: Roy!

Not a dumb question at all!

If you are on a Windows server with IIS and you have control over the server on which your site is hosted, then you could write a process that uses the InetTransfer control to read the directory listing of the folders in which these GIFs reside extract the name of the newest gif (I believe directory listing is in alpha order). You could then store the name in a database and pull the filename from the database when the page is accessed. If you know how often the images are updated, you could then automate the process to run every so often to get the filenames of the new images.

It sounds like it should be possible on the client side, too, but I do believe it will be more complicated.

RoySpencer
18-07-2003, 19:02/07:02PM
Polarmate:
Thanks for the advice...we'll look into that!

Qwerty: The GIF content changes....sorry if I made it sound like they didn't...they are weather radar images, updated every 8-11 minutes, and the last 10 are always posted in the same directory.

polarmate
18-07-2003, 19:09/07:09PM
Glad to be have been of some help!:)