valums/file-uploader — Issue #246: solution to the problem uploading files in IE
Author: diconart
Created: 2012-02-17 10:35:42+00:00
State: open

function save($path) {

if(count($_FILES)){

if(!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path)){
return false;
}

return true;
}else{

$input = fopen("php://input", "r");
$temp = tmpfile();
$realSize = stream_copy_to_stream($input, $temp);
fclose($input);

if ($realSize != $this->getSize()){
return false;
}

$target = fopen($path, "w");
fseek($temp, 0, SEEK_SET);
stream_copy_to_stream($temp, $target);
fclose($target);

return true;
}
}