Comparing revisions for FileView

Additions:
>>{{lastedit}}
Download the latest [[http://www.paranoidpress.com/~smaug/fileview.tgz Version]]>>fileview.php action:
(Not recomended for large directories or files tested on FreeBSD, Apache Server. I don't know what windows would do ##leave comment##)
Please comment if you find this action helpful It is my first "published" code and I would love to hear back from the community
KNOWN BUGS: file names with spaces ie. "This windows file.zip" will not link correctly.
# @name FileView
# @author {@link http://wikkawiki.org/SmaugDragon SmaugDragon} (first draft)
# @version 0.8
# wildcards work fine ie.
# @todo 1.) Restrict which files a user can show
# 2.) Files with spaces in the name do not link correctly
# 3.) I have to make files download instead of displaying that should fix 90% of my security worries.
if (!$location) { $location = "*.*"; } /* if location is not specified show all files in uploads */
$md5checksum_on = 1; /* calculate md5 checksums (1 = yes | 0 = no) */
echo '<table class="fv" summary="This table lists the files '.$location."\">\n";
echo '<tr class="fv" ><th class="fv" scope="col"> </th><th class="fv" scope="col">File</th><th class="fv" scope="col">Size</th><th class="fv" scope="col">Modified</th>';
echo '<td class="fv" id="nm"><a href='."$filename>$filedesc</a>";
Deletions:
>>Download the latest [[http://www.paranoidpress.com/files/fileview.zip Version]] Updated: July 24, 2006
{{lastedit}}>>fileview.php action:
(Not recomended for large directories or files.)
Tested on FreeBSD, Apache Server. I don't know what windows would do ##leave comment##
Please comment if you find this action helpful It is my first "published" code and I would love to hear back from the community.
# @name FileView
# @author {@link http://wikkawiki.org/SmaugDragon SmaugDragon}
# @version 0.9
# wildcards work fine ie.
# @todo 1.) Restrict which files a user can show
# 2.) I have to make files download instead of displaying that should fix 90% of my security worries.
$md5checksum_on = 0; /* calculate md5 checksums (1 = yes | 0 = no) */
if (!$location) { $location = "uploads/*.*"; } /* if location is not specified show all files in uploads */
echo "<table class=\"fv\" summary=\"This table lists the files ".$location."\">\n";
echo '<tr class="fv"><th class="fv" scope="col"> </th><th class="fv" scope="col">File</th><th class="fv" scope="col">Size</th><th class="fv" scope="col">Modified</th>';
echo '<td class="fv" id="nm"><a href='.str_replace(" ", "%20", $filename).">$filedesc</a>";
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki