Hi Anthony, sorry to disappoint but after a day trying, im still unable to solve this one. Hand?
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
ob_start();
session_start();
$extensions = array("jpg", "png","jpeg", "gif", "zip", "rar", "swf", "tiff", "bmp", "txt", "fla", "7z", "tar", "gz", "iso",
"dmg", "mp3", "wav", "m4a", "aac", "doc", "docx", "xls", "rtf", "ppt", "bsd", "exe", "psd", "c4d", "pdf", "dwg", "max", "ipa",
"vtf", "iam", "ipt", "flv", "cap", "scr");
$maxsize = 104288000;
$server = "http://www.testandre.com";
$name = $_FILES['file']['name'];
$temp = $_FILES['file']['tmp_name'];
$size = $_FILES['file']['size'];
$random = md5(uniqid(rand(), true));
$random = substr($random, 0, 20);
if (!$name || !$temp || !$size)
{
echo "Go back and select a file.";
exit();
}
foreach ($_FILES as $file)
{
if ($file['tmp_name'] != null)
{
$thisext1=explode(".", strtolower($file['name']));
$thisext=$thisext1[count($thisext1)-1];
if (!in_array($thisext, $extensions))
{
echo "That file type is not allowed.";
exit();
}
}
}
if ($size > $maxsize)
{
echo "File size too big.";
exit();
}
$destination = $_SERVER["DOCUMENT_ROOT"] . "/../Uploads/" . $random;
mkdir($destination);
move_uploaded_file($temp, $destination."/".$name);
$final = $server."/".$destination."/".$name;
$contents = file_get_contents("http://is.gd/create.php?format=simple&url=$final");
$yourfile = /var/www/vhosts/testandre.com/'.$destination.'/'.name;
?>
and elsewhere:
<input type="text" size="10" onClick=select() value="<?php readfile($yourfile); exit();?>" READONLY><p />