Hi,
I'm hoping that somebody can help me!?!?!
It's a bit strange really because I don't understand why I'm getting the following error:
Name 'txtAttach' is not declared
I've tried just having the FileBrowser in the 2nd declaration (line of coding), because it's actually in <input type="file"> in the HTML side of the coding, but this didn't work which is why the 1st line in! Hope I've not lost anyone?!
Does anybody understand/know why this error message is occurring?
Any ideas or pointers would be great!
Thanks in advance
Jane
I'm hoping that somebody can help me!?!?!
It's a bit strange really because I don't understand why I'm getting the following error:
Name 'txtAttach' is not declared
I've tried just having the FileBrowser in the 2nd declaration (line of coding), because it's actually in <input type="file"> in the HTML side of the coding, but this didn't work which is why the 1st line in! Hope I've not lost anyone?!
Code:
Dim FileBrower As String = txtAttach.Text
Dim FilenameAndExtention As String = System.IO.Path.GetFileName(FileBrowser.PostedFile.FileName)
Dim IndexOfDot As Integer = FilenameAndExtention.LastIndexOf(".")
Dim FilenameOnly As String = FilenameAndExtention.Substring(0, IndexOfDot)
Dim ExtentionOnly As String = FilenameAndExtention.Substring(IndexOfDot + 1, FilenameAndExtention.Length - IndexOfDot - 1)
Dim LocationToSave = Server.MapPath("~/Attachements/")
FileBrowser.PostedFile.SaveAs ( LocationToSave + FilenameAndExtention)
Dim DataLocation As String = ( LocacationToSave + FilenameAndExtention)
Any ideas or pointers would be great!
Thanks in advance
Jane