// Random file name letters
'random_name_alphabet' => 'qazwsxedcrfvtgbyhnujmikolp1234567890',
+ // Add original name (but cleaned) to file name if random file name feature is enabled?
+ 'suffix_original_name' => false,
+
// Display debugging information
'debug' => false,
$file_data['target_file_name'] = '';
while (strlen($file_data['target_file_name']) < $settings['random_name_len'])
$file_data['target_file_name'] .= $settings['random_name_alphabet'][mt_rand(0, strlen($settings['random_name_alphabet']) - 1)];
+ if ($settings['suffix_original_name'])
+ $file_data['target_file_name'] .= '_' . preg_replace('/[^0-9a-zA-Z_-]/', '', pathinfo($file_data['uploaded_file_name'], PATHINFO_BASENAME));
if ($settings['random_name_keep_type'])
$file_data['target_file_name'] .= '.' . pathinfo($file_data['uploaded_file_name'], PATHINFO_EXTENSION);
} while (isReadableFile($file_data['target_file_name']));