I have written a function to upload data from an excel spreadsheet to a form. Testing from my computer was successful. I migrated my vb.net code to the dev server and now I'm getting a rooted path message.
My code works with existing code written by someone else. I don't quite understand exactly what it is doing because there's no comments and I'm new to programming.
My thought is the first section of code is looking for the path of the file being submitted by the user (the IF section) and the second section of code (in the ELSE section) is -- not really sure actually as the code seems redundant. I do know we have a temp folder on the server. It would be helpful to understand what the code is doing so I can figure out where to put the server path. Can someone comment on the code to help me understand?
If WebPath.Contains("localhost") Then
FilePath = Path.Combine("c:\open", FileName)
FileUpload1.SaveAs(FilePath)
Else
Dim FolderPath As String = ConfigurationManager.AppSettings("FolderPath")
FilePath = FolderPath & FileName
FileUpload1.SaveAs(FilePath)
End If