Ok, well see, yours works.
My .php upload script is very similar, but WON'T work:
<!
===========================================================
||PHP Uploading Organizer ||
||Modified by: ||
||Kevin L. Arbogast (kslice) with help from: ||
||IntensityBill ||
||kevinarbogast@yahoo.com ||
||http://spaceballs.no-ip.org/ ||
|| ||
||Feel free to use with or without credits, I don't care.||
===========================================================
>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<style type="text/css">
//Reading the below, we can gather the following information:
//Anything wrapped in <h1></h1> tags will be size 16 font. <h2></h2> is size 14 font and so on.
body { color:#000000; font-family: Verdana, sans-serif; font-size: 12px; text-align:center; margin:0px; background:#000000; }
h1 { font-size:16px; padding:0px; margin:0px; }
h2 { font-size:14px; }
h3 { font-size:13px; }
#wrap { width:810px; margin:0 auto; background:#d60000; text-align:left; }
#header { font-size: 16px; padding:0px; margin:0px; background:#d60000; color:#000000; padding:10px; }
#content { margin:10px; background:#d60000; }
#content img {padding:5px; margin:0 auto; }
#apDiv1 {
position:absolute;
left:304px;
top:65px;
width:189px;
height:112px;
z-index:1;
}
.style8 {
color: #3399FF;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}
.style20 {color: #D60000}
</style>
</head>
<!
||==========================
||Start HTML Documentation||
||==========================
>
<title>SpaceBalls Upload</title>
<body>
<center>
<table width="580" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><!--DWLayoutTable-->
</table>
<div id="wrap">
<div id="header">
<h1>Upload Your Files</h1>
</div>
<div id="content">
<h2>Please check the rules about uploading in the Rules section
before uploading anything. </h2>
<br><br>
<h3>You can currently upload music, flash, images, archives, video, documents, and even programs!<br>More file types will be added in the future.</h3>
<table width="755" height="78" align="center" class="main_table">
<!--DWLayoutTable-->
<tr>
<td width="370" height="72" align="center" valign="top" bgcolor="#d60000"><form action="upload.php" method="post" enctype="multipart/form-data">
<div align="center">
<h1><span class="style8"> <span class="style20">Upload Your Files! </span></span></h1>
<h1><span class="style8"><br />
<input type="file" name="userimage" />
<input name="submit" type="submit" value="Upload" />
</span></h1>
</div>
<!
====================================================
||I'm sorry to say that you will have to manually ||
||enter in the maxium file size for now. I am ||
||hoping to have an update soon to read this ||
||automatically. Until then, you have to enter ||
||it manually. ||
====================================================
>
</form>Max File Size: 50MB.<td>
<!
||========================
||End HTML Documentation||
||========================
>
<!
||=========================
||Start Upload PHP Coding||
||=========================
>
<td width="368" align="left" valign="middle" bgcolor="#d60000"><p>
<?php
//=======================The Paths to each file type.==========================
$swfpath = "/Documents and Settings/Programmer/Desktop/SpaceBalls/files/flash/";
$imgpath = "/Documents and Settings/Programmer/Desktop/SpaceBalls/files/images/";
$musicpath = "/Documents and Settings/Programmer/Desktop/SpaceBalls/files/music/";
$videopath = "/Documents and Settings/Programmer/Desktop/SpaceBalls/files/videos/";
$exepath = "/Documents and Settings/Programmer/Desktop/SpaceBalls/files/programs/";
$docpath = "/Documents and Settings/Programmer/Desktop/SpaceBalls/files/documents/";
$rarpath = "/Documents and Settings/Programmer/Desktop/SpaceBalls/files/archives/";
$ddspath = "/Documents and Settings/Programmer/Deskotp/SpaceBalls/files/dds/";
//==============================End of Paths=======================================
//Maxium File Size. (in
*(in K
*(in M
*(in G
I'm sure you can figure that out.
$max_size = 1024*1024*50;
if (!isset($HTTP_POST_FILES['userimage'])) exit;
//==================================================Image Files Start========================================================
if (is_uploaded_file($HTTP_POST_FILES['userimage']['tmp_name']))
if ($HTTP_POST_FILES['userimage']['size']>$max_size) { echo "The file is too big \n"; exit; }
if (($HTTP_POST_FILES['userimage']['type']=="image/gif"
|| ($HTTP_POST_FILES['userimage']['type']=="image/pjpeg"
|| ($HTTP_POST_FILES['userimage']['type']=="image/jpeg"
|| ($HTTP_POST_FILES['userimage']['type']=="image/png"
|| ($HTTP_POST_FILES['userimage']['type']=="image/bmp"
) {
if (file_exists($imgpath . $HTTP_POST_FILES['userimage']['name'])) { echo "That file has already been uploaded.<br>\n"; exit; }
$res = copy($HTTP_POST_FILES['userimage']['tmp_name'], $imgpath .
$HTTP_POST_FILES['userimage']['name']);
if (!$res) { echo "Upload Failed!<br>\n"; exit; } else { echo "Upload Successful!<br>\n"; }
echo "File Name: ".$HTTP_POST_FILES['userimage']['name']."<br>\n";
$imgurl = "[
spaceballs.no-ip.org]['userimage']['name'];
echo "File Location: <a href=".$imgurl.">".$imgurl."</a><br>\n";
}
//===================================================Image Files End=========================================================
//---------------------------------------------------------------------------------------------------------------------------
//====================================================Flash Files Start======================================================
if ($HTTP_POST_FILES['userimage']['size']>$max_size) { echo "The file is too big \n"; exit; }
if (($HTTP_POST_FILES['userimage']['type']=="application/x-shockwave-flash"
) {
if (file_exists($swfpath . $HTTP_POST_FILES['userimage']['name'])) { echo "That file has already been uploaded.<br>\n"; exit; }
$res = copy($HTTP_POST_FILES['userimage']['tmp_name'], $swfpath .
$HTTP_POST_FILES['userimage']['name']);
if (!$res) { echo "Upload Failed!<br>\n"; exit; } else { echo "Upload Successful!<br>\n"; }
echo "File Name: ".$HTTP_POST_FILES['userimage']['name']."<br>\n";
echo "File Size: ".$HTTP_POST_FILES['userimage']['size']." bytes<br>\n";
$flashurl = "[
spaceballs.no-ip.org]['userimage']['name'];
echo "File Location: <a href=".$flashurl.">".$flashurl."</a><br>\n";
}
//====================================================Flash Files End========================================================
//---------------------------------------------------------------------------------------------------------------------------
//====================================================Music Files Start======================================================
if ($HTTP_POST_FILES['userimage']['size']>$max_size) { echo "The file is too big \n"; exit; }
if (($HTTP_POST_FILES['userimage']['type']=="audio/mp3"
|| ($HTTP_POST_FILES['userimage']['type']=="audio/mid"
|| ($HTTP_POST_FILES['userimage']['type']=="audio/wma"
|| ($HTTP_POST_FILES['userimage']['type']=="audio/mpeg"
|| ($HTTP_POST_FILES['userimage']['type']=="application/mp3"
) {
if (file_exists($musicpath . $HTTP_POST_FILES['userimage']['name'])) { echo "That file has already been uploaded.<br>\n"; exit; }
$res = copy($HTTP_POST_FILES['userimage']['tmp_name'], $musicpath .
$HTTP_POST_FILES['userimage']['name']);
if (!$res) { echo "Upload Failed!<br>\n"; exit; } else { echo "Upload Successful!<br>\n"; }
echo "File Name: ".$HTTP_POST_FILES['userimage']['name']."<br>\n";
echo "File Size: ".$HTTP_POST_FILES['userimage']['size']." bytes<br>\n";
$musicurl = "[
spaceballs.no-ip.org]['userimage']['name'];
echo "File Location: <a href=".$musicurl.">".$musicurl."</a><br>\n";
}
//===================================================Music Files End=========================================================
//---------------------------------------------------------------------------------------------------------------------------
//===================================================Video Files Start=======================================================
if ($HTTP_POST_FILES['userimage']['size']>$max_size) { echo "The file is too big \n"; exit; }
if (($HTTP_POST_FILES['userimage']['type']=="video/mpeg"
|| ($HTTP_POST_FILES['userimage']['type']=="video/x-ms-wmv"
) {
if (file_exists($videopath . $HTTP_POST_FILES['userimage']['name'])) { echo "That file has already been uploaded.<br>\n"; exit; }
$res = copy($HTTP_POST_FILES['userimage']['tmp_name'], $videopath .
$HTTP_POST_FILES['userimage']['name']);
if (!$res) { echo "Upload Failed!<br>\n"; exit; } else { echo "Upload Successful!<br>\n"; }
echo "File Name: ".$HTTP_POST_FILES['userimage']['name']."<br>\n";
echo "File Size: ".$HTTP_POST_FILES['userimage']['size']." bytes<br>\n";
$vidurl = "[
spaceballs.no-ip.org]['userimage']['name'];
echo "File Location: <a href=".$vidurl.">".$vidurl."</a><br>\n";
}
//===================================================Video Files End=========================================================
//---------------------------------------------------------------------------------------------------------------------------
//=================================================Program Files Start=======================================================
if ($HTTP_POST_FILES['userimage']['size']>$max_size) { echo "The file is too big \n"; exit; }
if (($HTTP_POST_FILES['userimage']['type']=="application/octet-stream"
|| ($HTTP_POST_FILES['userimage']['type']=="application/SoftWindows"
|| ($HTTP_POST_FILES['userimage']['type']=="application/unknown"
|| ($HTTP_POST_FILES['userimage']['type']=="magnus-internal/cgi"
|| ($HTTP_POST_FILES['userimage']['type']=="application/exe"
|| ($HTTP_POST_FILES['userimage']['type']=="application/x-exe"
|| ($HTTP_POST_FILES['userimage']['type']=="application/dos-exe"
|| ($HTTP_POST_FILES['userimage']['type']=="vms/exe"
|| ($HTTP_POST_FILES['userimage']['type']=="application/x-winexe"
|| ($HTTP_POST_FILES['userimage']['type']=="application/msdos-windows"
|| ($HTTP_POST_FILES['userimage']['type']=="application/x-msdos-program"
|| ($HTTP_POST_FILES['userimage']['type']=="application/x-msdownload"
|| ($HTTP_POST_FILES['userimage']['type']=="application/x-zip-compressed"
) {
if (file_exists($exepath . $HTTP_POST_FILES['userimage']['name'])) { echo "That file has already been uploaded.<br>\n"; exit; }
$res = copy($HTTP_POST_FILES['userimage']['tmp_name'], $exepath .
$HTTP_POST_FILES['userimage']['name']);
if (!$res) { echo "Upload Failed!<br>\n"; exit; } else { echo "Upload Successful!<br>\n"; }
echo "File Name: ".$HTTP_POST_FILES['userimage']['name']."<br>\n";
echo "File Size: ".$HTTP_POST_FILES['userimage']['size']." bytes<br>\n";
$exeurl = "[
spaceballs.no-ip.org]['userimage']['name'];
echo "File Location: <a href=".$exeurl.">".$exeurl."</a><br>\n";
}
//===================================================Program Files End=======================================================
//---------------------------------------------------------------------------------------------------------------------------
//==================================================Document Files Start=====================================================
if ($HTTP_POST_FILES['userimage']['size']>$max_size) { echo "The file is too big \n"; exit; }
if (($HTTP_POST_FILES['userimage']['type']=="application/msword"
|| ($HTTP_POST_FILES['userimage']['type']=="text/plain"
|| ($HTTP_POST_FILES['userimage']['type']=="application/pdf"
|| ($HTTP_POST_FILES['userimage']['type']=="text/richtext"
|| ($HTTP_POST_FILES['userimage']['type']=="application/rtf"
|| ($HTTP_POST_FILES['userimage']['type']=="application/x-rtf"
) {
if (file_exists($docpath . $HTTP_POST_FILES['userimage']['name'])) { echo "That file has already been uploaded.<br>\n"; exit; }
$res = copy($HTTP_POST_FILES['userimage']['tmp_name'], $docpath .
$HTTP_POST_FILES['userimage']['name']);
if (!$res) { echo "Upload Failed!<br>\n"; exit; } else { echo "Upload Successful!<br>\n"; }
echo "File Name: ".$HTTP_POST_FILES['userimage']['name']."<br>\n";
echo "File Size: ".$HTTP_POST_FILES['userimage']['size']." bytes<br>\n";
$docurl = "[
spaceballs.no-ip.org]['userimage']['name'];
echo "File Location: <a href=".$docurl.">".$docurl."</a><br>\n";
}
//==================================================Document Files End=======================================================
//---------------------------------------------------------------------------------------------------------------------------
//==================================================Archive Files Start======================================================
if ($HTTP_POST_FILES['userimage']['size']>$max_size) { echo "The file is too big \n"; exit; }
if (($HTTP_POST_FILES['userimage']['type']=="application/x-compressed"
|| ($HTTP_POST_FILES['userimage']['type']=="application/x-zip-compressed"
|| ($HTTP_POST_FILES['userimage']['type']=="application/zip"
|| ($HTTP_POST_FILES['userimage']['type']=="multipart/x-zip"
|| ($HTTP_POST_FILES['userimage']['type']=="application/rar"
|| ($HTTP_POST_FILES['userimage']['type']=="application/x-compressed"
) {
if (file_exists($rarpath . $HTTP_POST_FILES['userimage']['name'])) { echo "That file has already been uploaded.<br>\n"; exit; }
$res = copy($HTTP_POST_FILES['userimage']['tmp_name'], $rarpath .
$HTTP_POST_FILES['userimage']['name']);
if (!$res) { echo "Upload Failed!<br>\n"; exit; } else { echo "Upload Successful!<br>\n"; }
echo "File Name: ".$HTTP_POST_FILES['userimage']['name']."<br>\n";
echo "File Size: ".$HTTP_POST_FILES['userimage']['size']." bytes<br>\n";
$rarurl = "[
spaceballs.no-ip.org]['userimage']['name'];
echo "File Location: <a href=".$rarurl.">".$rarurl."</a><br>\n";
}
//================================================Archive Files End==========================================================
//---------------------------------------------------------------------------------------------------------------------------
//================================================DDS Files Start============================================================
if ($HTTP_POST_FILES['userimage']['size']>$max_size) { echo "The file is too big \n"; exit; }
if (($HTTP_POST_FILES['userimage']['type']=="image/x-dds"
|| ($HTTP_POST_FILES['userimage']['type']=="image/dds"
) {
if (file_exists($ddspath . $HTTP_POST_FILES['userimage']['name'])) { echo "That file has already been uploaded.<br>\n"; exit; }
$res = copy($HTTP_POST_FILES['userimage']['tmp_name'], $rarpath .
$HTTP_POST_FILES['userimage']['name']);
if (!$res) { echo "Upload Failed!<br>\n"; exit; } else { echo "Upload Successful!<br>\n"; }
echo "File Name: ".$HTTP_POST_FILES['userimage']['name']."<br>\n";
echo "File Size: ".$HTTP_POST_FILES['userimage']['size']." bytes<br>\n";
$ddsurl = "[
spaceballs.no-ip.org]['userimage']['name'];
echo "File Location: <a href=".$ddsurl.">".$ddsurl."</a><br>\n";
}
//===================================================DDS Files End===========================================================
?>
</p></td>
<!
||=====================
||End PHP Upload Code||
||=====================
>
</tr>
</table>
</div>
</div>
</body>
</html>
<!
||==================
||End of HTML Code||
||==================
>
<!END>