My goodness, I'm so closed to this thing being done but I have no idea. With certain files I upload it works, pictures and what not, then with some exes it works, but with rars and zips and different exes it doesnt work. Ok, so i've placed different echos to track how far the script gets after the submit button is hit, and it doesnt even pass the first check to see if the form is submitted and to make things worth after hitting submit my $FILES says theres nothing in it, but whats weird is sometimes it goes off without a hitch. I have my php.ini max file size set to 2500M.
if ($function =="downloads"){
var_dump($_FILES);
$ds = $_REQUEST['ds'];
echo "<b>".$ds."</b>";
if ($ds == "finished"){
$name = $_REQUEST['name'];
$category = $_REQUEST['type'];
$description = $_REQUEST['description'];
if (($name != "") and ($category != "") and ($_FILES['actual']['name'] != "")){
$size = $_FILES['actual']['size'];
$filename = $_FILES['actual']['name'];
echo $name." - ".$category;
$uploadDir = 'G:/Apache/www/upcoming/includes/downloadthumbs';
$uploadFile = $uploadDir ."/".$_FILES['actual']['name'];
if (!is_file($uploadFile)){
move_uploaded_file($_FILES['actual']['tmp_name'], $uploadFile);
$username = $_SESSION['username'];
echo $username;
echo " The file has been added.";
mysql_select_db("chadian");
mysql_query("INSERT INTO files (filename,name,date,size,description,category,username) VALUES('$filename', '$name', NOW(), '$size', '$description', '$category', '$username')");
}
else{ echo ", The file already exists.";}
}
}
else{
echo "<br><br>Downloads<br>Category types:<br>";
echo " Flash - Any .swf format either a flash game/movie or what have you.<br>
Audio - Wave, Mp3, Ogg, Wma audio formats<br>
Video - Avi, Mpeg, Wmv, Mov video formats<br>
Utilities & Tools - Files like Spyware tools<br>
Software - Files like iTunes, Winrar...<br>
Game/Demo - Games / Demos installable on your computer (not flash games)<br><br>";
echo "<form action=\"./index.php?link=admin&function=downloads\" enctype=\"multipart/form-data\" method=\"post\">";
echo "<b>Name of the file : </b><input type=\"text\" name=\"name\"><br><br>";
echo "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"2000000000\" />";
echo "<b>Browse for file : </b><input type=\"file\" name=\"actual\"><br>";
echo "<br><b>Category : </b><select name=\"type\">
<option>pick file category</option>
<option>Flash</option>
<option>Audio</option>
<option>Video</option>
<option>Document</option>
<option>Utilities & Tools</option>
<option>Software</option>
<option>Games/Demos</option>
</select><br><br>";
echo "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"2000000000\" />";
echo "<b>JPEG picture represting the file (optional): </b>";
echo "<input type=\"file\" name=\"jpegthumb\">";
echo "<br><br><b>Description (optional):</b><textarea name=\"description\"></textarea>";
echo "<br><br><input type=\"submit\" name=\"ds\" value=\"finished\">";
echo "</form>";
}
// flash, audio, video, games, documents, Utilities & Tools, Software
}