[CLOSED] File Postback

  1. #1

    [CLOSED] File Postback

    I have following cod
    <ext:FormPanel runat="server" ID="frmFileUpload" Title="File Validation" BodyPadding="5"
                Url="handlers/file_validator.ashx/processFile" Width = "450">
                <Items>
                    <ext:FileUploadField ID="flUploadfield" FieldLabel="File Name" runat="server" Width="400"
                        Icon="Attach">
                        <Listeners>
                        </Listeners>
                    </ext:FileUploadField>
                    <ext:FieldContainer ID="FieldContainer1" runat="server" Layout="HBoxLayout" Width = "400">
                        <LayoutConfig>
                            <ext:HBoxLayoutConfig Pack="End">
                            </ext:HBoxLayoutConfig>
                        </LayoutConfig>
                        <Items>
                            <ext:Button ID="Button1" runat="server" Text="Submit for validation file" Icon="StyleGo">
                                <Listeners>
                                    <Click Handler="#{frmFileUpload}.getForm().submit();" >
                                    </Click>
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:FieldContainer>
                </Items>
                <Buttons>
                </Buttons>
                <Listeners>
                    
                </Listeners>
            </ext:FormPanel>
    After file submit I am doing some processing and the result must be displayed but unfortunatly I am not able to do so
    for Example as displayed above form submits to the handlers/file_validator.ashx/processFile.

    public void processFile() {
    
            System.Threading.Thread.Sleep(2000);
            string flName =ctx.Request.Files["flUploadfield"].FileName;
            //process file and show result 
            
            Ext.Net.Window wnd = new Window();
            wnd.Width = new System.Web.UI.WebControls.Unit("100px");
            wnd.Height = new System.Web.UI.WebControls.Unit("100px");
            wnd.Html = "File has been processed";
            Ext.Net.ComponentLoader.Render(wnd);
    
    
           
                    
        }
    because postback occures how to deliver the message from processFile function
    Last edited by Daniil; Mar 24, 2014 at 3:39 PM. Reason: [CLOSED]
  2. #2
    Hi @odyssey,

    Do you use the DirectResponse class? If so, you should set up its IsUpload property to true.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @odyssey,

    Do you use the DirectResponse class? If so, you should set up its IsUpload property to true.
    this just works
    var window = new Window("Server time", Icon.Time)
            {
                ID = "MyWindow",
                Html = DateTime.Now.ToString(),
                Hidden = true
            };
    
            // some condition makes us show it now
            window.Show();
    
            return new DirectResponse(window.ToScript());
    I will stick with this solution
    Last edited by Daniil; Mar 24, 2014 at 2:06 PM. Reason: Please use [CODE] tags

Similar Threads

  1. [CLOSED] multiple file upload and file size at client side
    By mirwais in forum 1.x Legacy Premium Help
    Replies: 24
    Last Post: Dec 15, 2014, 5:44 AM
  2. Replies: 8
    Last Post: Jun 10, 2013, 1:06 PM
  3. Replies: 1
    Last Post: Mar 15, 2013, 1:38 AM
  4. Replies: 1
    Last Post: Dec 20, 2012, 7:30 AM
  5. Replies: 3
    Last Post: Nov 27, 2008, 12:52 PM

Posting Permissions