This is a migrated thread and some comments may be shown as answers.

Help with downloading file

3 Answers 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 20 Aug 2010, 07:52 PM
Hello, I am trying to download a file from SQL Server...here is the method I normally use.
Private Sub gvMain_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles gvMain.ItemCommand
      If e.CommandName = "DownLoad" Then
 
          sch = New clsReport
          Dim arr As ArrayList = sch.DownloadLetter(e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("ID"))
 
          Dim fil As Byte() = arr(0)
          Dim nam As String = arr(1)
          Dim ext As String = arr(2)
 
          If Not fil Is Nothing Then
              Response.Clear()
              Response.AddHeader("Content-Dispostiotion", nam & "." & ext)
              Response.AddHeader("Content-Length", fil.Length.ToString)
              Response.ContentType = "application/octet-stream"
              Response.BinaryWrite(fil)
              
          End If
      End If
 
 
 
  End Sub

Do I need to do something with the RadAjaxManager here...or the RadScriptManager? 
Thanks for any help.

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 23 Aug 2010, 12:33 PM
Hi Chris,

Downloading a file during an AJAX postback is unsupported feature. Please see this help topic describing how you can stop AJAX when only you request the file download.

All the best,
Simon
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Chris
Top achievements
Rank 1
answered on 23 Aug 2010, 07:13 PM
Do this by opening a radWindow, that loads another aspx page and executes the download. I have been trying this...but I am having issues specifying the path to the page using radOpen()
0
Kiara
Top achievements
Rank 1
answered on 24 Aug 2010, 09:03 AM
Probably this demo will help you define and pass the url to the page to the radopen method. Browse the online documentation of RadWindow if more details are needed.

Kiara
Tags
General Discussions
Asked by
Chris
Top achievements
Rank 1
Answers by
Simon
Telerik team
Chris
Top achievements
Rank 1
Kiara
Top achievements
Rank 1
Share this question
or