Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

CGI- Auto Hyperlinking to Folders/files

Posted on 2003-03-01
7
Medium Priority
?
207 Views
Last Modified: 2013-12-25
I have searched all over. can you help.
I have a site. with about 3000 files I need to hyperlink to. and I am constantaly updating and adding files to the folders. what I want to know is there a script that can call up the folders and automagically create the appropiate hyperlink. (it would be nice to also add , how many times it had been d/l too).
so when they go to example. themes. the themes html will check the folder and show a list of the contents for that folder (example 30 tones, listed by what they are saved as) for the user to download by just click on the link/name. and if its over example 30 itmes it allows for the user to go to page 2..3 etc.

I know it asking alot. but with over 3000 tones to index. its a pain. my old site. www.caferock.co.uk. was not too bad. but my new one has tripple the items.

www.mobelee.co.uk

Please help.. many thanks.
0
Comment
Question by:batman1056
  • 2
  • 2
5 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 8049189
why not using a simple directoy indexing which is done by the server
0
 

Author Comment

by:batman1056
ID: 8051252
thought about that but that will allow peeps to link to them and steel my bandwidth. cgi , would prevent this.

thanks
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 total points
ID: 8053074
then things get complicated ...
I'd suggest that you create static files when the browser accesses first time.
Anything else requires some kind of session management (or an application server).

Just think of following real scenarion:
  1. browser comes first time
     -> your cgi generates first page with 20 links
  2. browser comes again with the "next page" link but a few minutes later
     -> meanwhile the first 20 files have been changed
  3. browser comes again with sam URL as in 1. but a few hours/days/weeks later..
what should happen in case 2. and 3. ?
0
 
LVL 2

Assisted Solution

by:Itatsumaki
Itatsumaki earned 500 total points
ID: 8074113
Well, you could:
1. Keep a usage file in each directory (giving #/downloads)
2. Recurse the directories dynamically as need be.  Big time hit on your server's IO, but isn't impossible.

You would open a directory handle and display that.  You'd just pass the dir name as a (hidden) parameter in the script.

I don't like this approach one bit (since it gives away your directory structure for free) but it should do what you want....
0
 

Author Comment

by:batman1056
ID: 8078252
got it sorted. and its great. very easy to configure and autoupdates everthing. considering I have over 3000 files its great. PLUS got a proggy which can autoupdate ALL the folders at once with any updates.

thanks
www.mobelee.co.uk
tones section
user ruth
pass ruth

check it out many thanks
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question