Well, I've improved A LOT since I posted this lol and I've come a long way with my programming and projects such as
@editvideobot but I thought I'd come back and leave an answer for the sake of it!
(and yes
@pkSML I did end up using a script haha, I didn't want to back then because I was basically a vegetable at this stuff)
The actual script I use has a lot of stuff to do with the Twitter API and extra styling and stuff, so I'll give the basic examples by just modifying the examples
provided in the AbyssWS docs!
For PHP:
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>
Index of <?php echo $_POST['path']; ?>
</TITLE>
</HEAD>
<BODY>
<TABLE BORDER="0">
<TR>
<TD>Name</TD>
<TD>Size</TD>
<TD>Date</TD>
<TD>MIME Type</TD>
</TR>
<?php
/* Split and get the lines */
$lines = explode("\n", $_POST['files']);
/* For each line do... */
foreach ($lines as $line)
{
/* Split the line and get the file information */
list($name, $url, $size, $date, $mimetype) = explode("\t", $line);
if ($mimetype == ""){
}
else{
echo "<TR><TD><A HREF=\"$url\">" . htmlentities($name) .
"</A></TD><TD>$size</TD><TD>$date</TD><TD>$mimetype</TD></TR>";}
}
?>
</TABLE>
</BODY>
</HTML>
For Python 2 (just add parentheses the the print statements if you're using Python 3):
import cgi, string, os
posted_data = cgi.FieldStorage()
# Write the CGI header
print "Content-Type: text/html; charset=utf-8"
print
print "<HTML><HEAD>"
print "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">"
print "<TITLE>Index of %s</TITLE></HEAD>" % posted_data["path"].value
print "<TABLE BORDER='0'><TR><TD>Name</TD><TD>Size</TD><TD>Date</TD><TD>MIME Type</TD></TR>"
# Split and get the lines
lines = (posted_data["files"].value).split("\n")
# for each line do...
for line in lines:
# Split the line and get the file information
(name, url, size, date, mimetype) = line.split("\t")
if (mimetype == ""):
pass
else:
print "<TR><TD><A HREF=\"%s\">%s</A></TD>" % ( url, cgi.escape(name) )
print "<TD>%d</TD><TD>%s</TD><TD>%s</TD></TR>" % (int(size), date, mimetype)
print "</TABLE></BODY></HTML>"
The tabs might need to be fixed properly (I just edited this code here using 4 spaces) but the idea is simple; skip over anything that has a blank MIME type (e.g. a directory) and only show the actual files!