So I have my first ASP website project I want to deploy but need some help finishing up
My project will read a txt file database on users computer
using file upload:
Then I want to pass the file through a TextFieldParser function to create a tableCode:If FileUpload1.HasFile Then Try FileUpload1.SaveAs("C:\Uploads\" & _ FileUpload1.FileName) Label1.Text = "File name: " & _ FileUpload1.PostedFile.FileName & "<br>" & _ "File Size: " & _ FileUpload1.PostedFile.ContentLength & " kb<br>" & _ "Content type: " & _ FileUpload1.PostedFile.ContentType Catch ex As Exception Label1.Text = "ERROR: " & ex.Message.ToString() End Try Else Label1.Text = "You have not specified a file." End If
The porblem I am having is passing the fileCode:Dim safefilename As String = FileUpload1.FileName Dim sfilename As String = ("C:\Uploads\emailtest.txt") ReadTable(sfilename)
the first line Dim safefilename does not work
if I hard code the file location as in second line Dim sfilename it works
So I obviously need help getting the file properly
Also when I deploy the project on my webhost the file location will obviously be different and I am not sure how that works. Any help would be appreciated I have a little experience with vb.net but I am brand new to this web stuff
Thanks




Reply With Quote