Tried a number of ways to do this but this is the one that don't brake the site
Found the code on Stack Overflow All I have managed to do is remove the file name
$newFileName = $_FILES['picture']['name'][$n];
$title = $smcFunc['htmlspecialchars'](substr($newFileName, 0 , (strrpos($newFileName, "."))),ENT_QUOTES);
Any help would be appreciated
thanks mick
Sorry I don't know how to help, but I am really curious as to why?
Quote from: Aleksi "Lex" Kilpinen on January 28, 2022, 11:43:45 AMSorry I don't know how to help, but I am really curious as to why?
If you look here https://www.databasedreams.co.uk/charts/index.php?action=gallery;sa=view;id=12632 (https://www.databasedreams.co.uk/charts/index.php?action=gallery;sa=view;id=12632)
you'll see the picture has the extension on end I wanted to remove that
I have got a answer here: https://www.smfhacks.com/index.php/topic,10148.new.html#new
Thanks for the explanation, and for sharing your answer :)
Quote from: Aleksi "Lex" Kilpinen on January 28, 2022, 12:27:12 PMThanks for the explanation, and for sharing your answer :)
Haven't got it quite right SMFHacks Is looking at the script I'll post the correction.
Sorted It There seemed to be un-needed code As Below Commented out
//$title = $smcFunc['htmlspecialchars']($_REQUEST['title'][$n],ENT_QUOTES);
//if (empty($title))
//{
//Remove Ext Edit
$newFileName = $_FILES['picture']['name'][$n];
$tmpFile = substr($newFileName, 0 , (strrpos($newFileName, ".")));
$title = $smcFunc['htmlspecialchars']($tmpFile, ENT_QUOTES);
//}
https://www.databasedreams.co.uk/charts/index.php?action=gallery;sa=view;id=12637
Guests don't have access to that image