public function validate_upload_path()
{
if ($this->upload_path === '') {
$this->set_error('upload_no_filepath', 'error');
return FALSE;
}
if (realpath($this->upload_path) !== FALSE) {
$this->upload_path = str_replace('\\', '/', realpath($this->upload_path));
}
if (!is_dir($this->upload_path)) {
$this->set_error('upload_no_filepath', 'error');
return FALSE;
}
if (!is_really_writable($this->upload_path)) {
$this->set_error('upload_not_writable', 'error');
return FALSE;
}
$this->upload_path = preg_replace('/(.+?)\\/*$/', '\\1/', $this->upload_path);
return TRUE;
}