How to replace certain words from uploaded file name with underline or something

khpoletik4670

New Member
Jan 19, 2015
11
0
0
He guys

Does anybody know how to replace certain words from uploaded file name with underline or something?

for example assume that we are not going to allow this words to be included in a file name:

word1, word2, word3 etc

so if a user uploads a file named 'software.word1.x64.exe', it will be changed to 'software._.x64.exe'

Thanks
 

ysmods

New Member
Jan 29, 2013
860
1
0
UK
www.ysmods.com
You'd need to edit uploader.class.php and put in a str_replace() php function to do that.

Something like:
Code:
$words = array('word1', 'word2', 'word3');
foreach($words AS $word)
{
$filename = str_replace($word, '_', $filename);
}
The above code will not work, it is just an example.