public function getTempFile()
{
if (isset($this->_tmpfile)) {
return $this->_tmpfile;
}
$stream = $this->read();
$tmp = Horde::getTempFile('impatt');
$fd = fopen($tmp, 'w+');
while (!$stream->eof()) {
fwrite($fd, $stream->substring(0, 65536));
}
fclose($fd);
$stream->close();
return $tmp;
}