public function temporary(Storage_Model_File $model) { $tmp_file = APPLICATION_PATH . '/public/temporary/storage/' . $model->getIdentity() . '.' . $model->extension; $this->_mkdir(dirname($tmp_file)); if (!($handle = fopen($tmp_file, 'wb'))) { throw new Storage_Service_Exception('Unable to write to temporary file'); } $i = 0; while ($string = $this->_read($model, $i++)) { fwrite($handle, $string); } return $tmp_file; }