Using FileUp v3.31 and below, you will have to parse out the filename from the UserFileName property. UserFileName returns the full path and filename string from the client machine for an uploaded file.
Here's how to obtain just the filename from that string:
strFilename = Mid(oFileUp.UserFilename, InstrRev(oFileUp.UserFilename, "\") + 1)
For just the extension, use:
strExtension = Mid(oFileUp.UserFilename, InstrRev(oFileUp.UserFilename, ".") + 1)
In FileUp v3.32 and above, you can use the ShortFileName property instead. This property returns the user's original filename without path information, without the need for special parsing of the UserFileName property:
strFileName = oFileUp.ShortFileName
Note: If you have multiple file fields in your form, you will need to refer to them explicitly like this:
oFileUp.Form("fieldname").UserFileName
or
oFileUp.Form("fieldname").ShortFileName |