rtoss

Subversion Repositories:
Compare Path: Rev
With Path: Rev
/ @ 6  →  / @ 7
New file
/FileList/filelist.php
@@ -0,0 +1,499 @@
<?
/*
Directory Listing Script - Version 2
====================================
Script Author: Ash Young <ash@evoluted.net>. www.evoluted.net
Layout: Manny <manny@tenka.co.uk>. www.tenka.co.uk
 
REQUIREMENTS
============
This script requires PHP and GD2 if you wish to use the
thumbnail functionality.
 
INSTRUCTIONS
============
1) Unzip all files
2) Edit this file, making sure everything is setup as required.
3) Upload to server
4) ??????
5) Profit!
 
CONFIGURATION
=============
Edit the variables in this section to make the script work as
you require.
 
Start Directory - To list the files contained within the current
directory enter '.', otherwise enter the path to the directory
you wish to list. The path must be relative to the current
directory.
*/
$startdir = '.';
 
/*
Show Thumbnails? - Set to true if you wish to use the
scripts auto-thumbnail generation capabilities.
This requires that GD2 is installed.
*/
$showthumbnails = false;
 
/*
Show Directories - Do you want to make subdirectories available?
If not set this to false
*/
$showdirs = true;
 
/*
Force downloads - Do you want to force people to download the files
rather than viewing them in their browser?
*/
$forcedownloads = false;
 
/*
Hide Files - If you wish to hide certain files or directories
then enter their details here. The values entered are matched
against the file/directory names. If any part of the name
matches what is entered below then it is now shown.
*/
$hide = array(
'dlf',
'index.php',
'Thumbs',
'.htaccess',
'.htpasswd'
);
 
/*
Show index files - if an index file is found in a directory
to you want to display that rather than the listing output
from this script?
*/
$displayindex = true;
 
/*
Allow uploads? - If enabled users will be able to upload
files to any viewable directory. You should really only enable
this if the area this script is in is already password protected.
*/
$allowuploads = true;
 
/* Show delete button? */
$showdelete=true;
 
/* Upload/Delete password */
$uppass = "uppass";
 
/* Use PATH_INFO for the dirs? */
$usepathinfo=true;
/*
Overwrite files - If a user uploads a file with the same
name as an existing file do you want the existing file
to be overwritten?
*/
$overwrite = false;
 
/*
Index files - The follow array contains all the index files
that will be used if $displayindex (above) is set to true.
Feel free to add, delete or alter these
*/
 
$indexfiles = array (
'index.html',
'index.htm',
'index.php',
'default.htm',
'default.html'
);
 
/*
File Icons - If you want to add your own special file icons use
this section below. Each entry relates to the extension of the
given file, in the form <extension> => <filename>.
These files must be located within the dlf directory.
*/
$filetypes = array (
'png' => 'jpg.gif',
'jpeg' => 'jpg.gif',
'bmp' => 'jpg.gif',
'jpg' => 'jpg.gif',
'gif' => 'gif.gif',
'zip' => 'archive.png',
'rar' => 'archive.png',
'exe' => 'exe.gif',
'setup' => 'setup.gif',
'txt' => 'text.png',
'htm' => 'html.gif',
'html' => 'html.gif',
'fla' => 'fla.gif',
'swf' => 'swf.gif',
'xls' => 'xls.gif',
'doc' => 'doc.gif',
'sig' => 'sig.gif',
'fh10' => 'fh10.gif',
'pdf' => 'pdf.gif',
'psd' => 'psd.gif',
'rm' => 'real.gif',
'mpg' => 'video.gif',
'mpeg' => 'video.gif',
'mov' => 'video2.gif',
'avi' => 'video.gif',
'eps' => 'eps.gif',
'gz' => 'archive.png',
'asc' => 'sig.gif',
);
/*
That's it! You are now ready to upload this script to the server.
 
Only edit what is below this line if you are sure that you know what you
are doing!
*/
error_reporting(0);
 
// cgi.fix_pathinfo Workaround
if(isset($_SERVER['ORIG_PATH_INFO'])) $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
 
// IIS Workaround
if(strpos($_SERVER['PATH_INFO'],$_SERVER['SCRIPT_NAME'])!==false) $_SERVER['PATH_INFO'] = substr($_SERVER['PATH_INFO'],strlen($_SERVER['SCRIPT_NAME']));
 
function properSize($size,$maxcnt=0) {
$suffix=''; $suxAry=array("KB","MB","GB","TB");
$ccnt=$maxcnt?$maxcnt:count($suxAry);
for($cnt=0;$cnt<$ccnt;$cnt++)
if($size > 1024) {$size/=1024; $suffix=$suxAry[$cnt];}
return $suffix?sprintf("%.1f",$size).$suffix:$size.'B';
}
 
$myname=preg_replace('/.*\/+/', '', $_SERVER['PHP_SELF']);
$mypath=preg_replace("/$myname$/", '', $_SERVER['PHP_SELF']);
$myfilespath='http://'.$_SERVER['HTTP_HOST'].$mypath.'dlf';
 
if(!function_exists('imagecreatetruecolor')) $showthumbnails = false;
$leadon = $startdir;
if($leadon=='.') $leadon = '';
if((substr($leadon, -1, 1)!='/') && $leadon!='') $leadon = $leadon . '/';
$startdir = $leadon;
 
$cdir=isset($_GET['dir'])?$_GET['dir']:substr($_SERVER['PATH_INFO'],1);
 
if($cdir) {
//check this is okay.
 
if(substr($cdir, -1, 1)!='/') {
$cdir = $cdir . '/';
}
 
$dirok = true;
$dirnames = split('/', $cdir);
for($di=0; $di<sizeof($dirnames); $di++) {
 
if($di<(sizeof($dirnames)-2)) {
$dotdotdir = $dotdotdir . $dirnames[$di] . '/';
}
 
if($dirnames[$di] == '..') {
$dirok = false;
}
}
 
if(substr($cdir, 0, 1)=='/') {
$dirok = false;
}
 
if($dirok) {
$leadon = $leadon . $cdir;
}
}
 
if($_GET['download'] && $forcedownloads) {
$file = str_replace('/', '', $_GET['download']);
$file = str_replace('..', '', $file);
 
if(file_exists($leadon . $file)) {
header("Content-type: application/x-download");
header("Content-Length: ".filesize($leadon . $file));
header('Content-Disposition: attachment; filename="'.$file.'"');
readfile($leadon . $file);
die();
}
}
 
 
if($allowuploads && $_FILES['file'] && $_POST['pass']==$uppass) {
$upload = true;
if(!$overwrite) {
if(file_exists($leadon.$_FILES['file']['name'])) {
$upload = false;
}
}
 
if($upload) {
move_uploaded_file($_FILES['file']['tmp_name'], $leadon . $_FILES['file']['name']);
@chmod(0666,$leadon . $_FILES['file']['name']);
}
}
 
if($_POST['action']=="delete" && file_exists($leadon.$_POST['file']) && $_POST['pass']==$uppass) {
@unlink($leadon.$_POST['file']);
}
 
$opendir = $leadon;
if(!$leadon) $opendir = '.';
if(!file_exists($opendir)) {
$opendir = '.';
$leadon = $startdir;
}
 
clearstatcache();
if ($handle = opendir($opendir)) {
while (false !== ($file = readdir($handle))) {
//first see if this file is required in the listing
if ($file == "." || $file == "..") continue;
$discard = false;
for($hi=0;$hi<sizeof($hide);$hi++) {
if(strpos($file, $hide[$hi])!==false) {
$discard = true;
}
}
 
if($discard) continue;
if (@filetype($leadon.$file) == "dir") {
if(!$showdirs) continue;
 
$n++;
if($_GET['sort']=="date") {
$key = @filemtime($leadon.$file) . ".$n";
}
else {
$key = $n;
}
$dirs[$key] = $file . "/";
}
else {
$n++;
if($_GET['sort']=="date") {
$key = @filemtime($leadon.$file) . ".$n";
}
elseif($_GET['sort']=="size") {
$key = @filesize($leadon.$file) . ".$n";
}
else {
$key = $n;
}
$files[$key] = $file;
 
if($displayindex) {
if(in_array(strtolower($file), $indexfiles)) {
header("Location: $mypath$leadon$file");
die();
}
}
}
}
closedir($handle);
}
 
//sort our files
if($_GET['sort']=="date") {
@ksort($dirs, SORT_NUMERIC);
@ksort($files, SORT_NUMERIC);
}
elseif($_GET['sort']=="size") {
@natcasesort($dirs);
@ksort($files, SORT_NUMERIC);
}
else {
@natcasesort($dirs);
@natcasesort($files);
}
 
//order correctly
if($_GET['order']=="desc" && $_GET['sort']!="size") {$dirs = @array_reverse($dirs);}
if($_GET['order']=="desc") {$files = @array_reverse($files);}
$dirs = @array_values($dirs); $files = @array_values($files);
 
$pathtitle=str_replace('//','/',dirname($_SERVER['PHP_SELF']).'/'.$leadon);
$pathtitle=str_replace('\\','',$pathtitle);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Directory Listing of <?=$pathtitle;?></title>
<link rel="stylesheet" type="text/css" href="<?=$myfilespath;?>/styles.css" />
<?
if($showthumbnails) {
?>
<script language="javascript" type="text/javascript">
<!--
function o(n, i) {
document.images['thumb'+n].src = '<?=$myfilespath;?>/i.php?f='+i;
 
}
 
function f(n) {
document.images['thumb'+n].src = '<?=$myfilespath;?>/trans.gif';
}
//-->
</script>
<?
}
?>
<!--[if IE]>
<style type="text/css">
#listing a {
float:left;
}
</style>
<![endif]-->
</head>
<body>
<div id="container">
<h1>Directory Listing of <?=$pathtitle;?></h1>
<div id="breadcrumbs"> <a href="<?=$_SERVER['PHP_SELF'];?>">home</a>
<?
$breadcrumbs = split('/', $leadon);
if(($bsize = sizeof($breadcrumbs))>0) {
$sofar = '';
for($bi=0;$bi<($bsize-1);$bi++) {
$sofar = $sofar . $breadcrumbs[$bi] . '/';
echo ' &gt; <a href="'.$_SERVER['PHP_SELF'].'/'.urlencode($sofar).'">'.$breadcrumbs[$bi].'</a>';
}
}
 
$baseurl = $usepathinfo?$_SERVER['PHP_SELF'] . '/'.$cdir . '?':$_SERVER['PHP_SELF'] . '?dir='.$cdir . '&';
$fileurl = 'sort=name&amp;order=asc';
$sizeurl = 'sort=size&amp;order=asc';
$dateurl = 'sort=date&amp;order=asc';
 
switch ($_GET['sort']) {
case 'name':
if($_GET['order']=='asc') $fileurl = 'sort=name&amp;order=desc';
break;
case 'size':
if($_GET['order']=='asc') $sizeurl = 'sort=size&amp;order=desc';
break;
 
case 'date':
if($_GET['order']=='asc') $dateurl = 'sort=date&amp;order=desc';
break;
default:
$fileurl = 'sort=name&amp;order=desc';
break;
}
?>
</div>
<div id="listingcontainer">
<div id="listingheader">
<div id="headerfile"><a href="<?=$baseurl . $fileurl;?>">File</a></div>
<div id="headersize"><a href="<?=$baseurl . $sizeurl;?>">Size</a></div>
<div id="headermodified"><a href="<?=$baseurl . $dateurl;?>">Last Modified</a></div>
</div>
<div id="listing">
<?
$class = 'b';
if($dirok) {
?>
<div><a href="<?=$usepathinfo?$_SERVER['PHP_SELF'].'/'.urlencode($dotdotdir):$_SERVER['PHP_SELF'] . '?dir='.urlencode($dotdotdir);?>" class="<?=$class;?>"><img src="<?=$myfilespath;?>/dirup.png" alt="Folder" /><strong>..</strong> <em>-</em> <?=date ("M d Y h:i:s A", filemtime($dotdotdir));?></a></div>
<?
if($class=='b') $class='w';
else $class = 'b';
}
$arsize = sizeof($dirs);
for($i=0;$i<$arsize;$i++) {
?>
<div><a href="<?=$usepathinfo?$_SERVER['PHP_SELF'].'/'.urlencode($leadon.$dirs[$i]):$_SERVER['PHP_SELF'] . '?dir='.urlencode($leadon.$dirs[$i]);?>" class="<?=$class;?>"><img src="<?=$myfilespath;?>/folder.png" alt="<?=$dirs[$i];?>" /><strong><?=$dirs[$i];?></strong> <em>-</em> <?=date ("M d Y h:i:s A", filemtime($leadon.$dirs[$i]));?></a></div>
<?
if($class=='b') $class='w';
else $class = 'b';
}
 
$arsize = sizeof($files);
for($i=0;$i<$arsize;$i++) {
$icon = 'unknown.png';
$ext = strtolower(substr($files[$i], strrpos($files[$i], '.')+1));
$supportedimages = array('gif', 'png', 'jpeg', 'jpg');
$thumb = '';
 
if($showthumbnails && in_array($ext, $supportedimages)) {
$thumb = '<span><img src="'.$myfilespath.'/trans.gif" alt="'.$files[$i].'" name="thumb'.$i.'" /></span>';
$thumb2 = ' onmouseover="o('.$i.', \''.urlencode($leadon . $files[$i]).'\');" onmouseout="f('.$i.');"';
 
}
 
if($filetypes[$ext]) {
$icon = $filetypes[$ext];
}
 
$filename = $files[$i];
if(strlen($filename)>42) {
$filename = substr($files[$i], 0, 39) . '...';
}
 
$fileurl = $mypath.$leadon.$files[$i];
if($forcedownloads) {
$fileurl = $_SESSION['PHP_SELF'] . '?dir=' . urlencode($leadon) . '&amp;download=' . urlencode($files[$i]);
}
?>
<div><?php if($showdelete) { ?><a class="<?=$class;?>" style="float:left;text-align:left;width:0.5em;padding:2px;clear:none;" href="<?=$_SERVER['PHP_SELF'];?>?file=<?=urlencode($leadon.$files[$i]);?>&amp;action=del">D</a><?php } ?><a href="<?=$fileurl;?>" class="<?=$class;?>"<?=$thumb2;?>><img src="<?=$myfilespath;?>/<?=$icon;?>" alt="<?=$files[$i];?>" /><strong><?=$filename;?></strong> <em><?=properSize(filesize($leadon.$files[$i]),2);?></em> <?=date ("M d Y h:i:s A", filemtime($leadon.$files[$i]));?><?=$thumb;?></a></div>
<?
if($class=='b') $class='w';
else $class = 'b';
}
?></div>
<?
if($allowuploads) {
$phpallowuploads = (bool) ini_get('file_uploads');
$phpmaxsize = ini_get('upload_max_filesize');
$phpmaxsize = trim($phpmaxsize);
$last = strtolower($phpmaxsize{strlen($phpmaxsize)-1});
switch($last) {
case 'g':
$phpmaxsize *= 1024;
case 'm':
$phpmaxsize *= 1024;
}
 
?>
<div id="upload">
<div id="uploadtitle"><strong>File Upload</strong> (Max Filesize: <?=$phpmaxsize;?>KB)</div>
<div id="uploadcontent">
<?
if($phpallowuploads) {
?>
<form method="post" action="<?=$_SERVER['PHP_SELF'];?>?dir=<?=urlencode($leadon);?>" enctype="multipart/form-data">
<input type="file" name="file" /> Password: <input type="password" name="pass" value="" size="8" /> <input type="submit" value="Upload" />
</form>
<?
}
else {
?>
File uploads are disabled in your php.ini file. Please enable them.
<?
}
?>
</div>
 
</div>
<?
}
?>
<?
if($_GET['action']=="del" && file_exists($leadon.$_GET['file'])) {
?>
<div id="upload">
<div id="uploadtitle"><strong>File Delete Confirmation</strong></div>
<div id="uploadcontent">
Input password and press Delete button if you are sure to delete file <strong>&quot;<?=$_GET['file'];?>&quot;</strong>.<br />
<form method="post" action="<?=$_SERVER['PHP_SELF'];?>?dir=<?=urlencode($leadon);?>" enctype="multipart/form-data">
<input type="hidden" name="file" value="<?=$_GET['file'];?>"/><input type="hidden" name="action" value="delete"/>Password: <input type="password" name="pass" value="" size="8" /> <input type="submit" value="Delete" />
</form>
</div>
</div>
<?
}
?>
</div>
</div>
<div id="copy">Directory Listing Script &copy;2005 <a href="http://evoluted.net/">Ash Young</a>. Design by <a href="http://www.tenka.co.uk/">Manny</a>.</div>
</body>
</html>
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/jpg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/exe.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/sig.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/real.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/html.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/psd.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/eps.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/trans.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/bg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/video2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/folder.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/fh10.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/swf.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/setup.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/archive.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/dirup.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/fla.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/text.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/binary.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/html.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/gif.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/doc.gif
New file
/FileList/dlf/styles.css
@@ -0,0 +1,203 @@
body {
background-color: #E6E6E6;
}
 
h1 {
color: #6699FF;
font-family: Arial, Helvetica, sans-serif;
font-weight:bold;
font-size: medium;
margin: 0 0 10px 8px;
padding:0;
}
 
img {
border: 0;
}
 
form {
margin: 0;
padding: 0;
}
 
#container {
width: 600px;
margin-left:auto;
margin-right:auto;
border: 1px solid #CCCCCC;
padding: 9px;
background-color:#FFFFFF;
}
 
#breadcrumbs {
color: #6699FF;
font-family: Arial, Helvetica, sans-serif;
font-size:small;
margin: 0 0 8px 8px;
}
 
#breadcrumbs a, #breadcrumbs a:visited, #breadcrumbs a:link, #breadcrumbs a:active {
color: #6699FF;
text-decoration:none;
}
 
#breadcrumbs a:hover {
text-decoration:underline;
}
 
#listingcontainer {
background-image:url(bg.gif);
padding: 10px;
background-color:#E0DEDE;
}
 
#listingheader {
color: #476BB3;
font-weight:bold;
font-family:Arial, Helvetica, sans-serif;
font-size:small;
text-align:right;
}
 
#listingheader a, #listingheader a:active, #listingheader a:visited, #listingheader a:link {
text-decoration: none;
color: #476BB3;
}
 
#listingheader a:hover {
text-decoration: underline;
color: #476BB3;
}
 
 
#headerfile {
text-align:left;
float: left;
width: 320px;
}
 
#headersize {
text-align:right;
width: 75px;
float: left;
}
 
#listing {
border: 1px solid #A7C5FF;
}
 
#listing div {
clear:both;
}
 
#listing a {
display:block;
padding: 2px 5px 2px 3px;
font-size:small;
color: #6285CA;
font-family:Arial, Helvetica, sans-serif;
text-decoration:none;
width:570px;
text-align:right;
}
 
#listing a:hover {
background-color:#DBE6FE;
}
 
#listing a img {
float:left;
margin-right: 4px;
}
 
 
 
#listing a strong {
width: 300px;
float:left;
cursor:hand;
cursor:pointer;
text-align:left;
}
 
#listing a em {
float: left;
width: 75px;
text-align:right;
cursor:hand;
cursor:pointer;
}
 
#listing a span {
position: absolute;
margin-left: -151px;
margin-top: -2px;
}
 
#listing a span img {
width: 150px;
background-color:#CCCCCC;
visibility: hidden;
}
 
#listing a:hover span img {
border: 1px solid #666666;
visibility: visible;
}
 
#upload {
border: 1px solid #A7C5FF;
display:block;
margin-top: 10px;
font-size:small;
color: #6285CA;
font-family:Arial, Helvetica, sans-serif;
text-decoration:none;
width:568px;
background-color: #E9F0FF;
}
 
#uploadtitle {
background-color: #DBE6FE;
padding: 2px 5px 2px 5px;
border-bottom: 1px solid #A7C5FF;
}
 
#uploadcontent {
padding: 2px 5px 2px 5px;
}
 
 
#copy {
width: 600px;
margin-left:auto;
margin-right:auto;
text-align:center;
font-size:x-small;
color: #666666;
font-family:Arial, Helvetica, sans-serif;
}
 
#copy a {
text-decoration: underline;
color: #666666;
}
 
.b {
background-color: #E9F0FF;
}
 
.w {
background-color:#FFFFFF;
}
 
.mod {
float:right;
}
 
.size {
float:right;
}
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/video.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/xls.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/pdf.gif
New file
/FileList/dlf/i.php
@@ -0,0 +1,43 @@
<?php
$filename = '../'.$_REQUEST['f'];
 
if(!file_exists($filename)) die('Error: File does not exist');
if(!function_exists('imagecreatetruecolor')) die('Error: GD2 not installed / configured');
 
$fn_array = explode('.', $filename);
$type = strtolower(end($fn_array));
 
if ($type == 'jpg' || $type == 'jpeg') $img = @imagecreatefromjpeg($filename);
elseif ($type == 'png') $img = @imagecreatefrompng($filename);
elseif ($type == 'gif') {
if(!function_exists('imagecreatefromgif')) die('Error: Your version of GD does not support GIFs');
$img = @imagecreatefromgif($filename);
}
else die("Error: Image type not supported");
 
$x = imagesx($img);
$y = imagesy($img);
 
$width = 150;
$height = round(($y/$x) * $width);
 
$tmpimage = imagecreatetruecolor($width, $height);
imagecopyresampled($tmpimage, $img, 0, 0, 0, 0, $width, $height, $x, $y);
imagedestroy($img);
$img = $tmpimage;
 
if ($type == 'jpg' || $type == 'jpeg') {
header("Content-type: image/jpeg");
imagejpeg($img, '', 65);
}
elseif ($type == 'png') {
header("Content-type: image/png");
imagetruecolortopalette($img, false, 128);
imagepng($img);
}
elseif ($type == 'gif') {
header("Content-type: image/png");
imagetruecolortopalette($img, false, 128);
imagepng($img);
}
?>
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes:

Name: svn:mime-type
+ application/octet-stream

/FileList/dlf/unknown.png