Download

G

Guest

Hi to all
i use a code to download from test.aspx
when it's download it's download test.aspx not the file i spl
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
my code:

Dim filename As String = "http:\\localhost\Image\2005120200.jpg"
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", "attachment; filename="""
& filename & """")
Dim root As String = "C:\"
Dim files() As String = Directory.GetFiles(root)
Dim filepath As String = Request.Params("file")
If Not filepath Is Nothing Then
If File.Exists(filepath) And filepath.StartsWith(root) Then
Response.Clear()
Response.Flush()
Response.WriteFile(filepath)
End If
End If
''''''''''''''''''''''''
any ideas??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top