Yes it does, and sounds reasonable.
So i would move from the current structure of:
Within Root directory
/index.php
/upload.php
/Uploads
...etc...
to
Within root directory
/index.php
/upload.php
...etc...
Outside root
Uploads
It sounds do-able (my skills in mind), could i just ask how i would point to the folder Uploads in my php script?
I’m planning to put all uploads in there, and have them called from that directory when people want to download them.
<?php
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.uploadvillage.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 = "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");
?>