title: HTML5 AJAX File Uploader with progressbar error php
body: <p>i made one script from here but now i have problem with geting $_POST['file']</p>
  
  <p>her is the crsipt</p>
  
  <p>index.php</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;script src="jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="ajax.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;style&gt;
  progress
  {
      background-color:#FF0000;
      width:250px;
      min-height:2px;
      height:4px;
      border:none;
  }
  progress::-webkit-progress-bar-value, progress::-webkit-progress-value, progress::-moz-progress-bar, progress::progress-bar
  {
      background-color:#0F0;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;form enctype="multipart/form-data" method="post"&gt;
      &lt;input name="file" type="file" id="file" /&gt;
      &lt;input type="button" value="Upload" /&gt;
  &lt;/form&gt;
  &lt;div id="prc"&gt;&lt;/div&gt;%&lt;br&gt;
  &lt;progress value="0" min="0" max="100"&gt;&lt;/progress&gt;
  &lt;div id="det"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>ajax.js</p>
  
  <pre><code>// JavaScript Document
  $(function(){
      $(':file').change(function(){
          var file = this.files[0];
          name = file.name;
          size = file.size;
          type = file.type;
          $("#det").html("NAME: "+name+"&lt;br/&gt;SIZE: "+size+"&lt;br/&gt;TYPE: "+type);
          //your validation
      });
  
      $(':button').click(function(){
          var formData = new FormData($('form')[0]);
          $("#data").html(formData);
          $.ajax({
              url: 'upload.php',  //server script to process data
              type: 'POST',
              xhr: function() {  // custom xhr
                  myXhr = $.ajaxSettings.xhr();
                  if(myXhr.upload){ // check if upload property exists
                      myXhr.upload.addEventListener('progress',progressHandlingFunction, false); // for handling the progress of the upload
                  }
                  return myXhr;
              },
              //Ajax events
              //beforeSend: beforeSendHandler,
              success: function(html) {
                  $("#mess").html(html);
              },
              error:function(html) {
                  $("#mess").html(html);
              },
              enctype: 'multipart/form-data',
              // Form data
              data: formData,
              //Options to tell JQuery not to process data or worry about content-type
              cache: false,
              contentType: false,
              processData: false
          });
      });
      function progressHandlingFunction(e){
          if(e.lengthComputable){
              $('progress').attr({value:e.loaded,max:e.total});
              $('#prc').html(e.loaded);
          }
      }
  });
  </code></pre>
  
  <p>and the "upload.php" script when im geting the error</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['file'])){
      echo $_POST['file'];
  }else{
      echo 'file is not set';
  }
  ?&gt;
  </code></pre>
  
  <p>the resoults</p>
  
  <pre><code>NAME: ALISON LIMERICK - Where love lives.mp3
  SIZE: 16584832
  TYPE: audio/mp3
  
  &gt; file is not set
  </code></pre>
  
  <p>the progresbarr is working well but in php something wrong </p>
  
  <p>somebody help me??</p>