Need help to make php upload only accept zip, rar and swf

Clash Royale CLAN TAG#URR8PPPNeed help to make php upload only accept zip, rar and swf
Im currently developing an PHP File Uploader, however I only want the file uploader to accept zip, rar and swf files. I've tried everything but it doesn't work, here is my code. When im uploading for example and zip file im just getting my own upload error.
Upload.html
<head>
<link href="favicon.png" rel="shortcut icon" type="image/x-icon"/>
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-rc.2/css/materialize.min.css">
<link rel="stylesheet" href="pageloader.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-rc.2/js/materialize.min.js"></script>
<style>
.image-upload > input
{
display: none;
}
</style>
<title>Upload • CPPS Public Repository</title>
</head>
<body>
<div class="fixed-action-btn">
<a class="btn-floating btn-large lime accent-4" href="http://cpps.diabloscave.com">
<i class="material-icons">arrow_back</i>
</a>
</div>
<center>
<img src="logo.png">
<form enctype="multipart/form-data" action="uploadfile.php" method="POST">
Please choose a file: <input name="uploaded" type="file" /><br />
<input type="submit" value="Upload" />
</form>
</center>
</body>
</html>
Uploadfile.php
<?php
$target = ".";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
//This is our size condition
if ($uploaded_size > 256000000){
echo "Your file is too large. We have a 200MB limit.<br>";
$ok=0;
}
$types = array('application/zip', 'application/x-rar-compressed', 'application/x-shockwave-flash');
if (in_array($_FILES['uploaded']['type'], $types)) {
// file is okay continue
} else {
$ok=0;
}
//Here we check that $ok was not set to 0 by an error
if ($ok==0){
Echo "There was an error uploading your file. We only accept ZIP, RAR & SWF as filtypes.";
}
//If everything is ok we try to upload it
else{
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)){
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else{
echo "Sorry, there was a problem uploading your file. Please report to Diablo#9615 at Discord!";
}
}
?>
Please help!
if ($uploaded_size > 256000000)
$_FILES['uploadedfile']
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
if ($uploaded_size > 256000000), well that right there seems to have failed you, as did$_FILES['uploadedfile'].– Funk Forty Niner
23 secs ago