Revision history for FileView


Revision [23289]

Last edited on 2016-05-20 07:38:47 by SmaugDragon [Replaces old-style internal links with new pipe-split links.]
Additions:
>>Download the latest [[http://www.paranoidpress.com/files/fileview.zip | Version]] Updated: July 24, 2006
Deletions:
>>Download the latest [[http://www.paranoidpress.com/files/fileview.zip Version]] Updated: July 24, 2006


Revision [19352]

Edited on 2008-01-28 00:15:25 by SmaugDragon [Modified links pointing to docs server]

No Differences

Revision [17487]

Edited on 2007-09-14 06:15:34 by SmaugDragon [Modified links pointing to docs server]
Additions:
(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.
Deletions:
(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


Revision [17293]

Edited on 2007-07-25 06:40:06 by SmaugDragon [Modified links pointing to docs server]
Additions:
>>Download the latest [[http://www.paranoidpress.com/files/fileview.zip Version]] Updated: July 24, 2006
Deletions:
>>Download the latest [[http://www.paranoidpress.com/~smaug/fileview.tgz Version]] Updated: July 24, 2006


Revision [15075]

Edited on 2006-08-06 09:36:52 by SmaugDragon [Modified links pointing to docs server]
Deletions:
KNOWN BUGS: file names with spaces ie. "This windows file.zip" will not link correctly.


Revision [14966]

Edited on 2006-07-24 14:09:23 by SmaugDragon [Modified links pointing to docs server]
Additions:
>>Download the latest [[http://www.paranoidpress.com/~smaug/fileview.tgz Version]] Updated: July 24, 2006
Deletions:
>>Download the latest [[http://www.paranoidpress.com/~smaug/fileview.tgz Version]]


Revision [14965]

Edited on 2006-07-24 14:08:24 by SmaugDragon [Modified links pointing to docs server]
Additions:
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>';
if ($md5checksum_on == 1) echo '<th class="fv" scope="col">md5 Checksum</th></tr>'."\n"; else echo "</tr>\n";
echo '</table>';
Deletions:
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>";
if ($md5checksum_on == 1) echo "<th class=\"fv\" scope=\"col\">md5 Checksum</th></tr>\n"; else echo "</tr>\n";
echo "</table>";


Revision [14964]

Edited on 2006-07-24 14:04:38 by SmaugDragon [Modified links pointing to docs server]
Additions:
# @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>";
if ($md5checksum_on == 1) echo "<th class=\"fv\" scope=\"col\">md5 Checksum</th></tr>\n"; else echo "</tr>\n";
echo '<td class="fv" id="nm"><a href='.str_replace(" ", "%20", $filename).">$filedesc</a>";
echo "</table>";
Deletions:
# @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>';
if ($md5checksum_on == 1) echo '<th class="fv" scope="col">md5 Checksum</th></tr>'."\n"; else echo "</tr>\n";
echo '<td class="fv" id="nm"><a href='."$filename>$filedesc</a>";
echo '</table>';


Revision [14958]

Edited on 2006-07-23 19:33:49 by SmaugDragon [Modified links pointing to docs server]
Additions:
>>Download the latest [[http://www.paranoidpress.com/~smaug/fileview.tgz Version]]
{{lastedit}}>>fileview.php action:
Deletions:
>>{{lastedit}}
Download the latest [[http://www.paranoidpress.com/~smaug/fileview.tgz Version]]>>fileview.php action:


Revision [14957]

Edited on 2006-07-23 19:33:18 by SmaugDragon [Modified links pointing to docs server]
Additions:
>>{{lastedit}}
Download the latest [[http://www.paranoidpress.com/~smaug/fileview.tgz Version]]>>fileview.php action:
Deletions:
>>{{lastedit}}>>fileview.php action:


Revision [14956]

Edited on 2006-07-23 19:30:36 by SmaugDragon [Modified links pointing to docs server]
Additions:
echo '<table class="fv" summary="This table lists the files '.$location."\">\n";
Deletions:
echo '<table class="fv" summary="This table lists the files '.$location.">\n";


Revision [14955]

Edited on 2006-07-23 19:27:39 by SmaugDragon [Modified links pointing to docs server]
Additions:
# @todo 1.) Restrict which files a user can show
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>';
if ($md5checksum_on == 1) echo '<th class="fv" scope="col">md5 Checksum</th></tr>'."\n"; else echo "</tr>\n";
Deletions:
# @todo 1.) Restrict which files a user can show
if (!$location) { $location = "*.*"; } /* if location is not specified show all files in uploads */
$md5checksum_on = 0; /* 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>";
//if ($md5checksum_on == 1) echo "<th class=\"fv\" scope=\"col\">md5 Checksum</th></tr>\n"; else echo "</tr>\n";


Revision [14954]

Edited on 2006-07-23 19:21:19 by SmaugDragon [Modified links pointing to docs server]
Additions:
# @todo 1.) Restrict which files a user can show
if (!$location) { $location = "*.*"; } /* if location is not specified show all files in uploads */
Deletions:
# @todo 1.) Restrict which files a user can show
if (!$location) { $location = "*.*"; } /* if location is not specified show all files in uploads */


Revision [14953]

Edited on 2006-07-23 19:20:13 by SmaugDragon [Modified links pointing to docs server]
Additions:
#
# Displays a table of specified files from a local directory.
#
# *** SECURITY NOTICE ***
# Currently this script has the ability to show ANY file on the local system
# I am working on a fix. I believe that a fix could be made that would only
# show files in the ./uploads/UserName/directory I just have to write it.
#
# Credit:
# This action is derived from a script I wrote to display downloads for php-nuke
# Credit should be given to the author of the files action for the funtion
# bytesToHumanReadableUsage (see below)
#
# @package Actions
# @name FileView
#
# @author {@link http://wikkawiki.org/SmaugDragon SmaugDragon} (first draft)
# @version 0.8
# @since Wikka 1.1.6.0
#
# @input Url $location optional: the url of the files you want displayed.
# wildcards work fine ie.
# uploads /*/*.* all files in all directories under uploads
# uploads/ps_*.jpg all jpg files in uploads with names starting with ps_
#
# @Other Settings on|off $md5checksum_on off by default set to 1 for md5 checksum of files or 0 for off
#
# @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.
#
/* CSS Info */
echo '<style type="text/css">
</style>';
if (!$location) { $location = "*.*"; } /* if location is not specified show all files in uploads */
/* Taken from WikkaWakka actions/files.php */
/* End of borrowed Code */
/* Comment the next 2 lines to remove the table header.*/
//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>";
//if ($md5checksum_on == 1) echo "<th class=\"fv\" scope=\"col\">md5 Checksum</th></tr>\n"; else echo "</tr>\n";
echo '<td class="fv" id="sz">'.bytesToHumanReadableUsage(filesize($filename)).'</td>';
echo '<td class="fv" id="mf">'.date ("m/d/Y", filemtime($filename)).'</td>';
if ($md5checksum_on == 1) echo '<td class="fv" id="cd">'.md5_file($filename).'</td>';
echo '</table>';
Deletions:
<style type="text/css">
</style>
if (!$location) { $location = "uploads/*.*"; } /* if location is not specified show all files in uploads */
/* Taken from WikkaWakka actions/files.php */
/* End of borrowed Code */
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>";
if ($md5checksum_on == 1) echo "<th class=\"fv\" scope=\"col\">md5 Checksum</th></tr>\n"; else echo "</tr>\n";
echo "<td class=\"fv\" id=\"sz\">".bytesToHumanReadableUsage(filesize($filename))."</td>";
echo "<td class=\"fv\" id=\"mf\">".date ("m/d/Y", filemtime($filename))."</td>";
if ($md5checksum_on == 1) echo "<td class=\"fv\" id=\"cd\">".md5_file($filename)."</td>";
echo "</table>";


Revision [14940]

Edited on 2006-07-22 03:41:06 by SmaugDragon [Modified links pointing to docs server]
Additions:
$md5checksum_on = 0; /* calculate md5 checksums (1 = yes | 0 = no) */
Deletions:
Table formatting (css) obstructs other objects in Wikka - working on a fix
$md5checksum_on = 1; /* calculate md5 checksums (1 = yes | 0 = no) */


Revision [14939]

Edited on 2006-07-22 03:40:38 by SmaugDragon [Modified links pointing to docs server]
Additions:
table.fv {border:1px solid #000; border-collapse:collapse; font-family:arial,courier,sans-serif; font-size:90%; }
td.fv,th.fv{border:0px solid #000; border-collapse:collapse; padding:5px; }
thead th.fv{text-align:center; background:#9cf; }
tbody th.fv{text-align:center; background:#69c; }
tbody td.fv{text-align:right; background:#DDDDDD; }
#nm{width: 80px; text-align: left; }
#sz{width: 80px; text-align: right; }
#mf{width: 80px; text-align: right; }
#cd{width:120px; text-align:right; font-family:courier; }
$md5checksum_on = 1; /* calculate md5 checksums (1 = yes | 0 = no) */
/* Taken from WikkaWakka actions/files.php */
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>";
if ($md5checksum_on == 1) echo "<th class=\"fv\" scope=\"col\">md5 Checksum</th></tr>\n"; else echo "</tr>\n";
foreach (glob($location) as $filename) {$filedesc = end(explode('/', $filename));
echo '<td class="fv" id="ic"> </td>';
echo '<td class="fv" id="nm"><a href='."$filename>$filedesc</a>";
echo "<td class=\"fv\" id=\"sz\">".bytesToHumanReadableUsage(filesize($filename))."</td>";
echo "<td class=\"fv\" id=\"mf\">".date ("m/d/Y", filemtime($filename))."</td>";
if ($md5checksum_on == 1) echo "<td class=\"fv\" id=\"cd\">".md5_file($filename)."</td>";
?>
Deletions:
table {border:1px solid #000; border-collapse:collapse; font-family:arial,courier,sans-serif; font-size:90%; }
td,th{border:0px solid #000; border-collapse:collapse; padding:5px; }
thead th{text-align:center; background:#9cf; }
tbody th{text-align:center; background:#69c; }
tbody td{text-align:right; background:#DDDDDD; }
#nm{width: 80px; text-align: left; nowrap;}
#sz{width: 80px; text-align: right; nowrap;}
#mf{width: 80px; text-align: right; nowrap;}
#cd{width:120px; text-align:right; font-family:courier; nowrap;}
$md5checksum_on = 0; /* calculate md5 checksums (1 = yes | 0 = no) */
/* Taken from WikkaWakka actions files.php */
echo "<table summary=\"This table lists the files ".$location."\">\n";
echo "<tr><th scope=\"col\"> </th><th scope=\"col\">File</th><th scope=\"col\">Size</th><th scope=\"col\">Modified</th>";
if ($md5checksum_on == 1) echo "<th scope=\"col\">md5 Checksum</th></tr>\n"; else echo "</tr>\n";
foreach (glob($location) as $filename) {
echo "<td id=\"ic\"></td>";
echo "<td id=\"nm\"><a href=".$filename.">$filename</a>";
echo "<td id=\"sz\">".bytesToHumanReadableUsage(filesize($filename))."</td>";
echo "<td id=\"mf\">".date ("m/d/Y", filemtime($filename))."</td>";
if ($md5checksum_on == 1) echo "<td id=\"cd\">".md5_file($filename)."</td>";
?>


Revision [14938]

Edited on 2006-07-22 01:40:19 by SmaugDragon [Modified links pointing to docs server]
Additions:
>>{{lastedit}}>>fileview.php action:
Deletions:
>>{{lastedit}}>>
fileview.php action:


Revision [14937]

Edited on 2006-07-22 01:40:07 by SmaugDragon [Modified links pointing to docs server]
Additions:
>>{{lastedit}}>>
Deletions:
{{lastedit}}


Revision [14936]

Edited on 2006-07-22 01:39:48 by SmaugDragon [Modified links pointing to docs server]
Additions:
{{lastedit}}


Revision [14933]

Edited on 2006-07-22 01:06:40 by SmaugDragon [Modified links pointing to docs server]
Additions:
"" {{fileview location="uploads/*/*.*"}} all files in all subdirectorys of uploads !!!""
Deletions:
"" {{fileview location="uploads/*/*.*"}} all files in all subdirectorys of uploads !!!


Revision [14932]

Edited on 2006-07-22 01:06:18 by SmaugDragon [Modified links pointing to docs server]
Additions:
"" {{fileview location="uploads/*/*.*"}} all files in all subdirectorys of uploads !!!


Revision [14924]

Edited on 2006-07-20 18:29:46 by SmaugDragon [Modified links pointing to docs server]
Additions:
KNOWN BUGS: file names with spaces ie. "This windows file.zip" will not link correctly.
Table formatting (css) obstructs other objects in Wikka - working on a fix
Deletions:
KNOWN BUG: file names with spaces ie. "This windows file.zip" will not link correctly.


Revision [14918]

The oldest known version of this page was created on 2006-07-20 13:09:13 by SmaugDragon [Modified links pointing to docs server]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki