无法在我的wamp上保存视频(php)

Hello I'm new in web development and try not asking simple questions. I'm trying to save uploaded files with ajax to my wamp using php but my code only allows .jpg and .doc files to be saved. Here's the code with the upload button:

<!DOCTYPE html>

<body>

<input name="file" id="file" type="file" />
<br /><br />
<progress id="progress"></progress>

<script>

var fileInput = document.querySelector('#file'),
    progress = document.querySelector('#progress');

fileInput.onchange = function() {

    var xhr = new XMLHttpRequest();

    xhr.open('POST', 'community.php');

    xhr.upload.onprogress = function(e) {
        progress.value = e.loaded;
        progress.max = e.total;
    };

    xhr.onload = function() {
        var uploadStatus = document.getElementById("finish");
        document.getElementById('finish').innerHTML = 'Upload done !';      
    };

    var form = new FormData();
    form.append('file', fileInput.files[0]);

    xhr.send(form);

};

</script>

<p id="finish">
</p>

And here's the code of the treatment of the POST request:

$error    = NULL;
$filename = NULL; 

if (isset($_FILES['file']) && $_FILES['file']['error'] === 0) {

    $filename = $_FILES['file']['name'];
    $targetpath = getcwd() . '/' . $filename; // On stocke le chemin où enregistrer le fichier

    // On déplace le fichier depuis le répertoire temporaire vers $targetpath
    if (@move_uploaded_file($_FILES['file']['tmp_name'], $targetpath)) { // Si ça fonctionne
        $error = 'OK';
        try
        {
                $bdd = new PDO('mysql:host=localhost;dbname=test', 'root', '');
                echo "it worked" ;
        }
        catch(Exception $e)
        {
            die('Erreur : '.$e->getMessage());
        }
        $result= $_FILES['file']['name'];
        $bdd->exec("INSERT INTO videos(Name) VALUES('$result')");
        echo $result;
    } 

    else 
    { // Si ça ne fonctionne pas
        $error = "Failure of uploading";
    }
} else 
    {
    $error = 'No videos uploaded!';
    }


  if(isset($_POST["community.php"]))
      {

          $Location = $_POST["community.php"];
          FileFunc($Location);
      }

      function FileFunc($Location){

      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $Location);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      $myFile = curl_exec($ch);
      curl_close($ch);
 $file = 'myFile.pdf';
 file_put_contents($file, $myFile);
 }

And one line of javascript at the end:

window.top.window.uploadEnd("<?php echo $error; ?>", "<?php echo $filename; ?>");

The weird thing is in $file = 'myFile.pdf'; it doesn't work with .pdf files and only only .doc files are saved. When I put 'myFile.jpg' , pictures are saved in the wamp but when I try any video extension it doesn't work...

I tried using before for uploading and saving a file and it never saves files above 10mb, could anyone confirm me if it's normal?

Thank you for your time.

UPDATE at 15.00 gmt time : After my recent comment on this matter here's the same problem with Iframe:

The code with the button:

<form id="uploadForm" enctype="multipart/form-data" action="upload.php" target="uploadFrame" method="post">
    <label for="uploadFile">Image :</label>
    <input id="uploadFile" name="uploadFile" type="file" />
    <br /><br />
    <input id="uploadSubmit" type="submit" value="Upload !" />
</form>

The server answer (lighter version of the previous upload.php):