#-------minimal in.php example - Use whatever you want for receiving the file.
<?php die ; # remove this if actually using. #THIS CODE IS NOT SAFE FOR PRODUCTION OR LIVE SERVERS #No authentication, input detainting or sanity checks of any kind. #---general purpose debugging logging. $raw = file_get_contents("php://input"); $fromip = $_SERVER['REMOTE_ADDR']; $now = date("Ymd-H:i:s"); $fileout = fopen("in.log", "a"); fputs($fileout, "$now $fromip\n"); fputs($fileout, "REQUEST\n"); fputs($fileout, print_r($_REQUEST, 1)); fputs($fileout, "FILES\n"); fputs($fileout, print_r($_FILES, 1)); fputs($fileout, "\n"); fputs($fileout, "RAW\n"); fputs($fileout, $raw); $name = $_FILES['userfile']['name']; $size = $_FILES['userfile']['size']; $tempz = $_FILES['userfile']['tmp_name']; #You should put a full path here. FYI: An example, not a real path: $uploadfile = "/home/geeklabs.com/examples/playground/files/$name"; if (move_uploaded_file($tempz, $uploadfile)) { print "MOVED $tempz to $uploadfile" ; fputs($fileout, "MOVED $tempz to $uploadfile"); } else { fputs($fileout, "DID NOT MOVE $tempz to $uploadfile"); print "Error - could not move uploaded file: did not upload." ; } fclose($fileout); #ends logging print "OK" ; #habit.