Hi Everyone,
im doing a file upload and creating a random file name. I need to add the random string to the extention of the file uploaded. I currently have it working by grabbing the 4 right charaters, but if they upload a file with more that 3 (.html) it will corrupt the file when saving.
How can i detect the . in the string and grab what evers after it?
Also how can i check that there is on 1 . in the file?
Code:
'Generate Random file name
dim max,min
max=99999999
min=20000000
RanFileName = (Int((max-min+1)*Rnd+min))
' Add extension
FileExt = Right(file.FileName, 4)
' Merge Random File Name and extention
FileName = RanFileName & FileExt
Thanks
Tim
TDA