Hii KumarOp
above method is correct when you already know the directory level,
wht happend when you look for file name with
"c:\document Setting\document\folder1\folder2\test.doc"
In this case below expression would not give you correct result.
s1 = split("c:\document Setting\document\test.doc","\")
response.write (s1(3))
There should be some generalize function ,
try this
strfile="c:\document Setting\document\test.doc"
filenamestr=getFullFileName(strfile) '// will return test.doc
function getFullFileName(strFileName)
characterCount = Len(strFileName)
while (nextCharacter <> "/" And characterCount > 0)
nextCharacter = Mid(strFileName, characterCount, 1)
if nextCharacter <> "/" Then
newString = nextCharacter & newString
end if
characterCount = characterCount - 1
wend
getFullFileName = newString
end function
Hope this will help you
Cheers :)
vinod
|