CyberSlug Posted March 23, 2005 Share Posted March 23, 2005 If you want to post a bunch of files to your website and: 1) You want to be lazy 2) The web server does not allow virtual directory listings Example on a university network where web space is mappeed to a network drive. expandcollapse popup; CyberSlug 23 March ; CHANGE THE FOLLOWING PATH TO LOCATION OF FILES... $webspaceDrive = "W:\Misc" $searchHandle = FileFindFirstFile($webspaceDrive & "\*.*") ;backup original index.html file if found If FileExists($webspaceDrive & "\index.html") Then FileCopy($webspaceDrive & "\index.html", $webspaceDrive & "\index.html.old") $index = FileOpen($webspaceDrive & "\index.html", 2);overwrite FileWriteLine($index, '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">') FileWriteLine($index, '<html>') FileWriteLine($index, '<head>') FileWriteLine($index, ' <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">') FileWriteLine($index, ' <title>Index of file listing</title>') FileWriteLine($index, '</head>') FileWriteLine($index, '<body>') FileWriteLine($index, '<H1>Here is a listing of files:</H1>') While 1 $file = FileFindNextFile($searchHandle) If @error Then ExitLoop If $file = "." or $file = ".." or $file = "index.html" or $file = "index.html.old" Then ContinueLoop FileWrite($index, '<pre><a href="' & $file & '">' & $file & '<a>') $len = StringLen($file) For $width = 1 to 8 If $len < 8*$width Then FileWrite($index, @TAB) Next FileWrite($index, Round(FileGetSize($webspaceDrive & "\" & $file)/1024,2) & ' KB</pre>') WEnd FileWriteLine($index, "<br>") FileWriteLine($index, "Listing generated " & @Year & "-" & @Mon & "-" & @MDay & " " & @Hour & ":" & @Min & ":" & @Sec) FileWriteLine($index, '</body>') FileWriteLine($index, '</html>') FileClose($index) Func _StringRepeat($char, $count) Local $output, $i For $i = 1 to $count $output = $output & $char Next Return $output EndFunc Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jak Posted June 5, 2005 Share Posted June 5, 2005 (edited) Here is my modified version:Added Displaying "oben.txt" on the top of the page and "unten.txt" on the end of the page if exists. Added LogfileAdded Version InformationAdded Recursive ModeAdded Icons for FiletypesAdded "Last Modified" categoryAdded MB and GB for size informationName: GenIndexGNU GPLFor new versions see : http://www.jak-software.de/downloads/GenIndex or http://www.jak-software.de/genindex-en.htmlor send a mail to : webmaster@jak-software.de or julian.klode@gmail.com GenIndex121.zip Edited June 7, 2005 by jak My Website - My Functions for 7-zip32.dll Link to comment Share on other sites More sharing options...
jak Posted July 2, 2005 Share Posted July 2, 2005 (edited) GenIndex 2.0 is downloable now:See here: http://www.autoitscript.com/forum/index.php?showtopic=13138 Edited July 2, 2005 by jak My Website - My Functions for 7-zip32.dll Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now