Hello!
I need code that will allow the user to do the following:
1. Select a browse button and choose the folder they want to save a file once the exe file at the end of the program runs
2. Display the folder location the user selected in the textbox next to it
Basically this is a save dialog box but since this is a web application and not a web form I can not use the dialog boxes.
Here is the code I have so far, I am thinking its not right so please help me with this!
Protected Sub Browse_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Browse.Click
Dim FilePath As String = ("C:\Users\Public\Documents")
Dim targetFile As System.IO.FileInfo = New System.IO.FileInfo(FilePath)
If targetFile.Exists Then
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + targetFile.Name)
Response.AddHeader("Content-Length", targetFile.Length.ToString)
Response.ContentType = "application/octet-stream"
Response.WriteFile(targetFile.FullName)
End If
End Sub
Thank you