Dim lcControl As String = "" Dim lcFileName As String = "" Dim lnFileSize As Integer = 0 Dim lnLocation As Integer = 0 Dim loFileUpload As System.Web.UI.WebControls.FileUpload = New System.Web.UI.WebControls.FileUpload Dim loHttpPostedFile As System.Web.HttpPostedFile = Nothing ' Get a reference to the control loFileUpload = oProcess.oPage.FindControl(lcControl + "$FileUpload") ' If the file was uploaded If Not loFileUpload Is Nothing Then ' Get a reference to the posted file loHttpPostedFile = loFileUpload.PostedFile ' See if the file was submitted If Not loHttpPostedFile Is Nothing Then ' Get the file size lnFileSize = loHttpPostedFile.ContentLength ' If the file was submitted If lnFileSize > 0 Then ' Get the file name lcFileName = loHttpPostedFile.FileName ' The following is to make sure we do not negotiate with a full path. This has been discovered ' when the upload is done thru a local network. It took over two years of thousands of uploads ' to discover that one. So, we always verify for the path first and adjust accordingly. ' Try to search for a \ lnLocation = oApp.RAt("\", lcFileName) ' If we have a full path If lnLocation > 0 Then lcFileName = Mid(lcFileName, lnLocation + 1) End If