function get_filename_by_digest($digest) { global $config; $directory = get_dir_by_digest($digest); $filename = $directory . '/' . substr($digest, 2); return $filename; }
protected function place_uploaded_file($upload, $digest) { $directory = get_dir_by_digest($digest); $filename = get_filename_by_digest($digest); if (!file_exists($directory)) { mkdir($directory); } return move_uploaded_file($upload['tmp_name'], $filename); }