private function nameFile($path='', $extension, $method, $original_name='') {
$path = trim($path);
$path = $path == '' ? './' : $path;
$method = (!check_value($method) || !in_array($method, array('original', 'random', 'mixed')) ? 'original' : $method);
$original_name = preg_replace('/\.+/', '_', substr($original_name,0,strrpos($original_name, ".")));
$original_name = !check_value($original_name) ? generateRandomString(rand(5,10)) : preg_replace('/\.(.*)$/', '', $original_name); // Original name as it
$original_name = preg_replace('/\s+/', '_', $original_name); // Original name with spaces changed to "_"