File size: 3.63Kb
<?php
/* Upload Routine */
if(isset($fupload))
{
require 'config.php';
$ext = strrchr($fupload_name,'.');
if ($ext == $filetype1 || $ext == $filetype2 || $ext == $filetype3 || $ext == $filetype4 || $ext == $filetype5 || $ext == $filetype6 || $ext == $filetype7 || $ext == $filetype8 || $ext == $filetype9)
{
/* Peform Upload Actions */
$final_path=$file_dir . "/" . $fupload_name; # Generate final path & filename.
move_uploaded_file( $fupload, $final_path ) or die ("Unable To Copy"); # Moves file.
/* Perform Post Upload Actions */
upload_report($fupload, $fupload_name, $fupload_size, $fupload_type, $file_url, $file); # Call upload report generation function.
}
else
{
echo '<script language="JavaScript">';
echo 'error = window.open("error.php?id=filetype","","width=350,height=235,status=no,toolbar=no,menubar=no");';
echo '</script>';
}
}
?>
<?php
/* Upload Report Generation Function */
function upload_report($fupload, $fupload_name, $fupload_size, $fupload_type, $file_url, $file)
{
/* Generate Upload Report */
require('config.php');
echo '<font face="verdana" color="ffff00" text="#800080">';
echo "<img src='$logo_file'>";
Print "<h3>файл удачно загружен</h3>";
echo '</font>';
echo '<font fache="verdana" color="#800080">';
print "<b>имя файла:</b> $fupload_name<br>";
print "<b>вес: </b> $fupload_size bytes<br>";
print "<b>формат: </b> $fupload_type<p>";echo '</font>';
echo '<font face="verdana" color="#00ffff">';
print "<b>обменивайтесь файлами на http://lim.hih.ru</b><br>";
echo '</font>';
}
?>
<?php
/* Directory Listing Function */
function directory_listing($file_dir, $file_url)
{
require('config.php'); # Reads in configuration file.
$directory = opendir ($file_dir); # Open Directory for reading.
echo '<div class = "container">'; # Use CSS Class (container).
echo '<font face="verdana" color="darkblue">'; # Sets font face & color.
echo "<img src='$logo_file'>"; # Display FileFusian logo.
echo '<div class = "header">'; # Use CSS class (header).
echo '<h3>Directory Listing</h3>'; # Display file listing page title.
echo '</div>'; # End CSS class (header).
print "<h6>A maximum of $listsize files will be displayed.</h6>"; # Displays number of files to be displayed.
print "<hr>"; # Displays horizontal rule.
echo '<table>'; # Create table.
for($fcount = 0; $fcount < $listsize; $fcount++) # File display loop - runs until $listsize value is reached.
{
$file = readdir ($directory);
echo '<tr><td>'; # Create table row, get ready for data.
if($file != "" && $file != "." && $file != "..")
{
echo '<img src="http://efusian.co.uk/~filefusian/images/download.gif">'; # Link to download icon.
print " <a href='$file_url/$file'>$file</a>"; # Prints filename hyperlink to directory listing.
}
echo '</td></tr>'; # Close table data and row.
}
echo '</table>'; # Close table.
echo '</div>'; # End CSS class (container).
closedir ($directory); # Close directory.
}
?>