<HTML>
<HEAD>
<TITLE>File upload interface</TITLE>
</HEAD>
<BODY><TABLE><CENTER>
<?
if($UploadAction){
$UploadAction=0;
$TimeLimit=60;
/*Set the timeout limit time. The default time is 30s. When set to 0, it is unlimited*/
set_time_limit($TimeLimit);
If(($Upfile != "none")&&
($Upfile != ""))
{
$Filepath="d:webwebphptest"; //Upload file storage path
$FileName=$Filepath.$Upfile_name;
if($Upfile_size <1024) //Upload file size
{$FileSize = (string)$Upfile_size . "bytes";}
elseif($Upfile_size <(1024 * 1024))
{
$FileSize = number_format((double)($Upfile_size / 1024), 1) . " KB";
}
else
{
$FileSize = number_format((double)($Upfile_size/(1024*1024)),1)."MB";
}
if(!file_exists($FileName))
{
if(copy($Upfile,$FileName))
{unlink($Upfile);
echo "<br><br>n";
echo "File $Upfile_name has been uploaded successfully!";
echo "<br><br>n";
echo "File location: $FileName";
echo "<br><br>n";
echo "File size: $FileSize";
echo "<br><br>n";
}
else
{echo "File $Upfile_name upload failed!"; }
}
else
{echo "The file $Upfile_name already exists!"; }
}
else
{echo "You did not select any files to upload!"; }
set_time_limit(30); //Restore default timeout settings
}
?>
<FORM ENCTYPE = "multipart/form-data" NAME = "SubmitForm"
ACTION = "default.php" METHOD = "POST">
<INPUT TYPE = "hidden" NAME = "MAX_FILE_SIZE" VALUE = "1000000">
<INPUT TYPE = "hidden" NAME = "UploadAction" VALUE = "1">
<TR><TD><INPUT NAME = "Upfile" TYPE = "file" SIZE = "30"></TD>
</TR><TR><TD><INPUT NAME = "submit" VALUE = "submit" TYPE = "submit">
<INPUT NAME = "reset" VALUE = "Reset" TYPE = "reset"></TD>
</TR></FORM></CENTER></TABLE>
</BODY>
</HTML>