...

View Full Version : How i do i get the file name now?



jaywhy13
01-05-2005, 03:09 PM
Set Upload=Server.CreateObject("Persits.Upload.1")
Count = Upload.SaveVirtual ("/uploads")


I just used that to upload the file, how now do i get the file name... not the file.path, just the name of the file.

ghell
01-05-2005, 03:30 PM
ive never used this COM component (i eventually found a pure asp one) so im not entirely sure, if you can get the full path you can get the filename out of it like this

strFilePath = "..."
arrFilePath = Split(strFilePath, "\")
strFileName = arrFilePath(UBound(arrFilePath))
this gets the file path, splits it at any \s (use /s if it isnt a physical path) and displays everything after the last \

you may be able to do a for each loop on the object to see all of the properties of that object and it will just tell you which to use, i would suggest looking where you got it from for a list of collections, methods, properties etc



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum