예제 #1
0
include "scripts/dupFindSimple.php";
// Provide access to thumbnail creation methods.
include "scripts/thumbnailer.php";
/*******************************
 *                             *
 *    Environment Variables    *
 *                             *
 *******************************/
// Upload directory information.
$truTarget = "/var/www/srthesis/uploads/";
$druTarget = "/var/www/srthesis/uploads_reduced/";
$publicThumbTarget = "/var/www/srthesis/thumbnails_reduced/";
// Details about the file being used in the system.
$sFileName = $_FILES['image_file']['name'];
$sFileType = $_FILES['image_file']['type'];
$sFileSize = bytesToSize1024($_FILES['image_file']['size'], 1);
/*********************************/
/* Thumbnail function variables. */
/*********************************/
// Width for thumbnail images we use for fingerprinting; Recommended 150.
$thumbWidth = 150;
// Width for public visible thumbnail (Whatever the <img /> width is).
$publicThumbSize = 215;
// Sets how sensitive the fingerprinting will be.
// Higher numbers are less sensitive (more likely to match). Floats are allowed.
$sensitivity = 2;
/*******************************
 *                             *
 *      Global Variables       *
 *                             *
 *******************************/
예제 #2
0
<?php

function bytesToSize1024($bytes)
{
    //RISKY ! in time, size may increase ! I'll take a look
    $unit = array('B', 'KiB', 'MiB', 'GiB');
    return @round($bytes / pow(1024, $i = floor(log($bytes, 1024))), 1) . ' ' . $unit[$i];
}
$df = bytesToSize1024(disk_free_space("/"));
// will be stuck into a block file.
$maxfiles = 500;
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>(c) ACTICIA</title>
		<link href="css/main.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		<header>
			<h2>The Storage Area</h2>
		</header>
		<div class="container">
			<div class="contr">
				<h2>Upload your files (max <?php 
echo $maxfiles;
?>
 files at once)</h2> <!-- read $maxfiles --> 
			</div>
			<div class="upload_form_cont">
예제 #3
0
     } else {
         if ($e > 7) {
             return true;
         } else {
             return false;
         }
     }
 }
 function secure($file)
 {
     return preg_replace('#(.+)\\.php#i', '$1.SECURED_PHP', $file);
 }
 if (isset($_FILES['myfile']) && strtolower($_FILES['myfile']['name']) != "index.html") {
     $sFileName = secure($_FILES['myfile']['name']);
     $sFileType = $_FILES['myfile']['type'];
     $sFileSize = intval(bytesToSize1024($_FILES['myfile']['size'], 1));
     $sFileError = error2msg($_FILES['myfile']['error']);
     $sFileExt = pathinfo($_SESSION['upload_path'] . $sFileName, PATHINFO_EXTENSION);
     $ok = '<li class="DD_file DD_success ' . $sFileExt . '">   
         <span class="DD_filename">' . $sFileName . '</span>
         [<em class="DD_filetype">' . $sFileType . '</em>, 
         <em class="DD_filesize">' . $sFileSize . '</em>] [OK]
     </li>';
     $notok = '<li class="DD_file DD_error">   
         <span class="DD_filename">' . $sFileName . '</span>
         [<em class="DD_filetype">' . $sFileType . '</em>, 
         <em class="DD_filesize">' . $sFileSize . '</em>] [UPLOAD ERROR !]
     </li>';
     if (is_array($auto_dropzone['destination_filepath']) && !empty($auto_dropzone['destination_filepath'][$sFileExt]) && is_dir($_SESSION['upload_path'] . $auto_dropzone['destination_filepath'][$sFileExt])) {
         $sFileName = $auto_dropzone['destination_filepath'][$sFileExt] . $sFileName;
         echo $ok;
예제 #4
0
     } else {
         if ($e > 7) {
             return true;
         } else {
             return false;
         }
     }
 }
 function secure($file)
 {
     return preg_replace('#(.+)\\.php#i', '$1.SECURED_PHP', $file);
 }
 if (isset($_FILES['myfile']) && strtolower($_FILES['myfile']['name']) != "index.html") {
     $sFileName = secure($_FILES['myfile']['name']);
     $sFileType = $_FILES['myfile']['type'];
     $sFileSize = bytesToSize1024($_FILES['myfile']['size'], 1);
     $sFileError = error2msg($_FILES['myfile']['error']);
     $sFileExt = pathinfo($sFileName, PATHINFO_EXTENSION);
     $ok = '<li class="DD_file DD_success ' . $sFileExt . '">   
         <span class="DD_filename">' . $sFileName . '</span>
         [<em class="DD_filetype">' . $sFileType . '</em>, 
         <em class="DD_filesize">' . $sFileSize . '</em>] [OK]
     </li>';
     $notok = '<li class="DD_file DD_error">   
         <span class="DD_filename">' . $sFileName . '</span>
         [<em class="DD_filetype">' . $sFileType . '</em>, 
         <em class="DD_filesize">' . $sFileSize . '</em>] [UPLOAD ERROR !]
     </li>';
     if (is_array($auto_dropzone['destination_filepath']) && !empty($auto_dropzone['destination_filepath'][$sFileExt]) && is_dir($auto_dropzone['destination_filepath'][$sFileExt])) {
         $sFileName = $auto_dropzone['destination_filepath'][$sFileExt] . $sFileName;
         echo $ok;