Using ajaxSubmit with powerTip to upload files

Using ajaxSubmit with powerTip to upload files

Hiya:

I am trying to use pop-up box to select a file which then gets updated.   I've done a test case here:

http://clickcreations.com/ben.php

I can read other form fields (for example, $_REQUEST['pk']), but the $_FILES are not being registered as set and I can't see an error or the file name.  It looks like they just aren't being sent.  If I make the form visible (so it doesn't pop-up) it works fine it is just as a pop-up form that it doesn't work. 

Anyone with any ideas on what I can do to get this to work?

Thanks in Advance!


-Ben.

The HTML (ben.php) is:

<html>
<head>
<title>Test</title>
<script src="/js/jquery-2.0.3.min.js"></script>
<script src="/js/jquery.powertip.js"></script> <!-- v. 1.2.0 -->
<script src="/js/jquery.form.js"></script> <!-- v. 3.49.0 -->
<link rel="stylesheet" href="/css/jquery.powertip.css" />
</head>
<body>
<script  type="text/javascript">
$(document).ready(function(){
  varRecord = 1
  $(".uploadIMAGE").bind('change', function() {
    $("#itemimgform2").ajaxSubmit({
        complete: function(xhr) {
            //status.html(xhr.responseText);
            alert(xhr.responseText);
        }
    });
  });
  $("#changeimg2").data("powertipjq", $("#imagechange2"));
  $("#changeimg2").powerTip({
      placement: "e",
      mouseOnToPopup: true,
  });

});
</script>
<div style="display:none;" id="hidden2">
    <div id="imagechange2">
      <form action="file.php" method="post" enctype="multipart/form-data" id="itemimgform2" >
          <input type="hidden" name="type" value="item" />
          <input type="hidden" name="pk" value="2" />
          <input type="file" name="myfile" id="myfile" class="uploadIMAGE" />
      </form>                        
    </div>
</div>
<img src="http://i.ebayimg.com/t/Vintage-1994-Duncan-MIDNIGHT-SPECIAL-Black-RARE-Yo-Yo-Yo-Yo-Mint-on-package-/00/s/MTYwMFgxMjAw/z/zvIAAOxydINSUcqF/$(KGrHqR,!r!FIybzvb-eBSUcqEZy9w~~60_35.JPG"  id="changeimg2" />
</body>
</html>

and the upload file (file.php):

<?
$upload_dir = "lists/";
if (isset($_FILES["myfile"])) {
    if ($_FILES["myfile"]["error"] > 0) {
        echo "Error: " . $_FILES["file"]["error"] . "<br>";
    } else {
        //move_uploaded_file($_FILES["myfile"]["tmp_name"], $upload_dir . $_FILES["myfile"]["name"]);
       
        echo "Tried to upload".$_FILES['myfile']['name'];
    }
} else {
    echo '$_FILES["myfile"] is not set but the PK is: '.$_REQUEST['pk'];
}
?>