Help with downloading file

4 posts, 0 answers
  1. Chris
    Chris avatar
    2 posts
    Member since:
    Aug 2010

    Posted 20 Aug 2010 Link to this post

    Hello, I am trying to download a file from SQL 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.AddHeader("Content-Dispostiotion", nam & "." & ext)
                  Response.AddHeader("Content-Length", fil.Length.ToString)
                  Response.ContentType = "application/octet-stream"
              End If
          End If
      End Sub

    Do I need to do something with the RadAjaxManager here...or the RadScriptManager? 
    Thanks for any help.
  2. Simon
    Simon avatar
    2281 posts

    Posted 23 Aug 2010 Link to this post

    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,
    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
  3. Chris
    Chris avatar
    2 posts
    Member since:
    Aug 2010

    Posted 23 Aug 2010 Link to this post

    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()
  4. Kiara
    Kiara avatar
    309 posts
    Member since:
    Jul 2006

    Posted 24 Aug 2010 Link to this post

    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.

Back to Top