rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: chrno on April 27, 2007, 01:31:51 PM

Title: Search files function
Post by: chrno on April 27, 2007, 01:31:51 PM
Hi everybody,
Surelly you have been in this situation: you're in rush and you need to find a file and you don't know where it is ... well that's why I'm requesting all your knowledage to make a search-files function for HFS templates.
I think there're two ways to do it, the first one is a script that search the %list% generated by HFS and then display a list with the results in a [search-results] section (hard way)
The second way is rejetto add a "wonderful" %search% section where user inputs the file name or extension and HFS returns the matches in the [search-results] or another "special" page.

what do you think?  ;)



Title: Re: Search files function
Post by: TSG on April 27, 2007, 01:49:29 PM
I've asked for this already in the past >_<
Title: Re: Search files function
Post by: rejetto on April 27, 2007, 01:49:32 PM
you ask for a recursive file list, then use the search feature of your browser. ( /~files.lst?recursive )

you may even create a javascript function that downlods such list and search in it.
Title: Re: Search files function
Post by: traxxus on April 27, 2007, 02:00:55 PM
I think, rejetto himself is the best way to implement a search "engine"  ;D
Title: Re: Search files function
Post by: Foggy on April 27, 2007, 02:40:56 PM
I use a simple batch file to create a site map that you can search with your browsers search, similar to what That_stevens_guy asked for. the only requirments of it are you need to be using real folders with the same file structure that is represented on hfs as the folders on the hdd.
the batch file runs this command from within the root folder and creates a text file called site map with a map of all folder and files.
Code: [Select]
for %%B in (.) do tree "%%~fB" /F>"Site Map.txt"
Foggy
Title: Re: Search files function
Post by: Giant Eagle on April 29, 2007, 08:13:31 PM
you ask for a recursive file list, then use the search feature of your browser. ( /~files.lst?recursive )

you may even create a javascript function that downlods such list and search in it.

Yes, i've been thinking about this one..

But calling a complete file list on my fileserver makes it hang for about 2 hours resulting in a 2gig file list that is sended to the client.

Well... not really, but a complete list is asking too much of HFS to be called usefull. 'specially on slow servers with +2000 files.

The idea posted by Foggy is a good one too, except that you have to run that batch file every time a new file has been added to the fileserver in order to be completely usefull.
Title: Re: Search files function
Post by: Foggy on April 30, 2007, 02:56:08 AM
yeah, thats the only drawback to my idea but when im the only one the adds files to my hfs it works for me. :D
Title: Re: Search files function
Post by: maverick on April 30, 2007, 08:48:18 AM
I suppose a site filename dump is ok if you are giving everybody access to all of the files on your server.  In my case, I set up different access levels for different types of users.  For example, my Guest users only get search results for their access level, my more trusted and registered users get search results for their access levels ... etc.  An actual search engine is used.
Title: Re: Search files function
Post by: Antseh on May 01, 2007, 01:27:59 PM
Maverick, what search engine do you use?
Title: Re: Search files function
Post by: maverick on May 03, 2007, 05:08:19 AM
Maverick, what search engine do you use?
Search Engine Builder Pro.  More info HERE (http://www.aleadsoft.com/).
Title: Re: Search files function
Post by: Antseh on May 03, 2007, 05:54:42 AM
Thanks for that  ;);):):)