How to upload files?
if($UploadAction){
$UploadAction=0;
$TimeLimit=60;
/*Set the timeout limit time. The default time is 30s and set to 0 Time is unlimited*/
set_time_limit($TimeLimit);
If(($Upfile != "none")&&
($Upfile != ""))
{
$ Filepath="d:webwebphp est"; //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 "
";
echo "File $Upfile_name has been uploaded successfully! ";
echo "
";
echo "File location: $FileName";
echo "
";
echo "File size: $FileSize";
echo "
";
}
else
{echo "File $Upfile_name failed to upload! "; }
}
else
{echo "The file $Upfile_name already exists! "; }
}
else
{echo "You did not select any files to upload! "; }
set_time_limit(30); //Restore the default timeout setting
}
?>