For some reason this script will upload files so long as they are under 1 MB... anything over that and the file never makes it to the server. Any help would be much appreciated. TIA.
<form enctype="multipart/form-data" action="<?php $SERVER['PHP_SELF'] ?>" method="POST">
<div align="left"> Model:
<input type="file" name="file">
<p> Image To Go With Model:
<input type="file" name="image">
<p> Name To Appear With File:
<input type="text" name="user_name">
<br>
<div align="center">File Description</div>
<div align="center"><textarea name="desc" rows="10" cols="60"></textarea></div>
<div align="center"><input type="submit" name="submit" value="Upload"></div>
<input type="hidden" name="submitted">
</div>
</form>
<?php
$db = "vault_main";
include("login.inc");
if(isset($POST['submitted'])) {
$user = $POST['user_name'];
$tmpname_file = $FILES['file']['tmp_name'];
$tmpname_image = $FILES['image']['tmp_name'];
$name_file = $FILES['file']['name'];
$name_image = $FILES['image']['name'];
//$final = $dir . $name;
$file_size = $FILES['file']['size'];
$ip = getenv("REMOTE_ADDR");
$description = $POST['desc'];
//echo $ip;
$var_1 = 0;
$var_2 = 0;
$file_error = 0;
$image_error = 0;
$file_type = $FILES['file']['type'];
$image_type = $FILES['image']['type'];
echo $FILES['file']['type'];
echo "<br>" . $FILES['image']['type'];
/if($name_file == "" || $name_file == "none" || $name_file == none || $name_image == "" || $name_image == "none" || $name_image == none) {
echo "You Must Choose A File First";
}
if($file_type == "application/x-zip-compressed" || $file_type == "application/rar" || $file_type == "application/zip" || $file_type = "application/x-rar-compressed" || $file_type == "application/octet-stream") {
//echo "File Type Okay";
$var_1 = 1;
}else{
echo "File Type Incorrect <br>";
}
if($image_type == "image/pjpeg" || $image_type == "image/x-png" || $image_type == "image/gif") {
//echo "Image Type Okay";
$var_2 = 1;
}else{
echo "Image Type Incorrect <br>";
}/
if($var_1 == 0 && $var_2 == 0) {
if(!move_uploaded_file($tmpname_file, "models/" . $name_file)) {
echo "Error Uploading Model <BR>";
$file_error = 1;
}
if(!move_uploaded_file($tmpname_image, "models/thumbs/" . $name_image)) {
echo "Error Uploading Image <BR>";
$image_error = 1;
}
if($file_error == 0 && $image_error == 0) {
$file_dir = "models/" . $name_file;
$image_dir = "models/thumbs/" . $name_image;
mysql_query("INSERT INTO models(model_user_name, model_thumb_dir, model_file_name, model_file_dir, model_file_size, model_upload_date, model_upload_time, model_upload_ip, model_file_desc) VALUES ('$user', '$image_dir', '$name_file', '$file_dir', '$file_size', curdate(), curtime(), '$ip', '$description')")or die(mysql_error());
echo "Files Uploaded Successfully";
echo "<BR>" . $file_dir . "<BR>" . $image_dir . "<BR>";
}
}
Also, if anyone here knows how to tab instead of using a ton of spaces, let me know please!
The page in question is at http://vault1.3dvault.net/contact-4.php
-David