Gossamer Forum
Home : Products : DBMan : Customization :

periods in filenames

Quote Reply
periods in filenames
i am using multi file upload hacked for specific filenames (image and thumb) from array in cfg. i noticed some files with names like "thumb .web.jpg" that i wanted to be "thumb.jpg". looking in code i found
Code:


###### hack for array filenames
$filename = $newfile[int($Number)] . substr($filename,index($filename,"."));
######

if i understand this correctly, index finds the FIRST occurence of "." and uses all original filename from that point on. i changed code to:
Code:


###### hack for array filenames
$filename = $newfile[int($Number)] . substr($filename,rindex($filename,".")); #changed index to rindex
######

that seems to have solved the problem. it also eliminates problems with spaces in filename. does anyone see a problem with this?

Last edited by:

delicia: Oct 16, 2004, 2:45 PM