[CLOSED] File Download is not working and getting BADRESPONSE

  1. #1

    [CLOSED] File Download is not working and getting BADRESPONSE

    Hi,

    I am trying to save file to local machine from web site. I have implement small file save functionality, but I am getting error like Status Code : 200 and Status Text : BADRESPONSE Expected ')'. I don't think the error ')' is in the file. The file content is small one as showing below...

    EH ATLOS YYYY02DDENV_CONTROL_NO
    TH TRANSACTION_IDTRANS_CONTROL_NO

    This above text saved as "Amaral78.fnm" in the folder where web page exist. I am giving small example here ...

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="ExtExportFile.aspx.vb" Inherits="Testing_ExtExportFile" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="resMngr" runat="server" />
        <ext:Button ID="btnExport" runat="server" Text="Export File">
            <DirectEvents>
                <Click OnEvent="ExportFile">
                </Click>
            </DirectEvents>
        </ext:Button>
        </form>
    </body>
    </html>
    and Code behind...
    Imports Ext.Net
    
    Partial Class Testing_ExtExportFile
        Inherits System.Web.UI.Page
    
        Public Sub ExportFile(ByVal sender As Object, ByVal e As DirectEventArgs)
            Dim sDataFile As String = Server.MapPath("Amaral78.fnm")
    
            HttpContext.Current.Response.ContentType = "application/octet-stream"
            HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=test.fnm")
            HttpContext.Current.Response.WriteFile(sDataFile)
            HttpContext.Current.Response.End()
        End Sub
    End Class
    Please let me know where I have to modify?
    Last edited by Daniil; Feb 23, 2012 at 2:24 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please set up
    IsUpload="true"
    for the DirectEvent.
  3. #3
    Hi Daniil,

    Thank you it is working for direct events. What about DirectMethods? Where I have to add this IsUpload="true"?

    Quote Originally Posted by Daniil View Post
    Hi,

    Please set up
    IsUpload="true"
    for the DirectEvent.
  4. #4
    Into a DirectMethod config, but with lower-case first letter.

    Example

    Ext.net.DirectMethods.Download({
             isUpload : true
    });
  5. #5
    Hi Daniil,

    Thank you. You can close this thread.

    Quote Originally Posted by Daniil View Post
    Into a DirectMethod config, but with lower-case first letter.

    Example

    Ext.net.DirectMethods.Download({
             isUpload : true
    });

Similar Threads

  1. Replies: 3
    Last Post: Mar 14, 2012, 1:35 PM
  2. [CLOSED] BADRESPONSE downloading a file
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Feb 24, 2012, 4:12 PM
  3. Replies: 1
    Last Post: Aug 30, 2010, 6:40 PM
  4. Replies: 2
    Last Post: May 15, 2009, 9:41 AM
  5. File download not working in ajax method...
    By speedstepmem2 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 08, 2009, 5:28 AM

Tags for this Thread

Posting Permissions