<?php
function movedunk($tempfile,$thefile){
$handle = fopen($tempfile, "r");
$response = '';
while ($line = @fgets($handle,1024)){
$response .= $line;
}
//Release the handle
fclose ($handle);
$fp = fopen ($thefile, 'w');
$line = fwrite($fp,$response);
/* Close the file handle */
fclose($fp);
}
//process_upload.php
//Allowed file MIME types.
$allowedtypes = array ("image/jpeg","image/pjpeg","image/png","image/gif");
//Where we want to save the file to.
$savefolder = "/www/htdocs/ajaxmonyet/repo";
//If we have a valid file
if (isset($_FILES['myfile'])){
//FIXME: file type checking not yet implemented coz i dont know what swf should belong.
//Then we can perform the copy.
if ($_FILES['myfile']['error'] == 0){
$thefile = $savefolder . "/a" . $_FILES['myfile']['name'];
!movedunk ($_FILES['myfile']['tmp_name'], $thefile);
}
}
?>