[CLOSED] file download on the update

  1. #1

    [CLOSED] file download on the update

    I have a file repository where there hyperlinkcolumns with dataindexhref . I update the file , the URL remains the same , with the same filename, but downloads the old file . That would be cache problem ?


            <ext:FormPanel runat="server" AutoScroll="true" Frame="true">
                <Items>
                    <%--CONTEÚDO PÁGINA--%>
                    <ext:GridPanel runat="server"
                                   AutoScroll="true"
                                   Margin="10"
                                   ID="gridRelatoriosGerenciais"
                                   Frame="true">            
                        <Store>
                            <ext:Store runat="server" ID="storeRelatoriosGerenciais" IDMode="Static" AutoLoad="true">
                                <Model>
                                    <ext:Model runat="server">
                                        <Fields>
                                            <ext:ModelField Name="AREA" Type="String" />
                                            <ext:ModelField Name="VE_NOME" Type="String" />
                                            <ext:ModelField Name="VE_OBJETIVO" Type="String" />
                                            <ext:ModelField Name="VE_VERSAO" Type="String" />
                                            <ext:ModelField Name="VE_DTALTER" Type="Date" />
                                            <ext:ModelField Name="VE_ARQUIVO" Type="String" />
                                        </Fields>
                                    </ext:Model>
                                </Model>
                            </ext:Store>
                        </Store>            
                        <ColumnModel>
                            <Items>
                                <ext:Column runat="server"
                                            Flex="2"
                                            Text="AREA"
                                            Hideable="false"
                                            hidden="false"
                                            DataIndex="AREA">
                                     <Filter>
                                        <ext:StringFilter />
                                    </Filter>                                
                                </ext:Column>
                                <ext:HyperlinkColumn runat="server"
                                                     DataIndex="VE_NOME"
                                                     DataIndexHref="VE_ARQUIVO"
                                                     width="250"
                                                     Text="NOME"
                                                      Hideable="false"
                                                      Hidden="false"
                                                    HrefPattern="{href}"
                                                    
                                                       >
                                    <Filter>
                                        <ext:StringFilter />
                                    </Filter>
    
                                </ext:HyperlinkColumn>                          
                                 <ext:Column runat="server"
                                            Flex="6"
                                            Text="OBJETIVO"
                                            Hideable="false"
                                            Hidden="false"
                                            DataIndex="VE_OBJETIVO">
                                     <Filter>
                                        <ext:StringFilter />
                                    </Filter>
                                </ext:Column>
    
                                <ext:Column runat="server"
                                            width="50"
                                            Text="VERSÃO"
                                            Hideable="false"
                                            Hidden="false"
                                            DataIndex="VE_VERSAO">
    
                                </ext:Column>
    
                                <ext:Column runat="server"
                                            width="120"
                                            Text="ULTIMA ATUALIZAÇÃO"
                                            Hideable="false"
                                            Hidden="false"
                                            DataIndex="VE_DTALTER">
                                </ext:Column>     
                               </Items>
                       </ColumnModel>
                                   <Plugins>
                                     <ext:GridFilters runat="server" />
                                 </Plugins>
                    </ext:GridPanel>
                </Items>
            </ext:FormPanel>

    public partial class NOVO_RelatoriosGerenciais : System.Web.UI.Page
    {
        public void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                ResourceManager resourceManager = (ResourceManager)this.Master.FindControl("resourceManager");
                this.retornaDados();
                
            }
        }
    
        public void retornaDados()
        {
            DataTable dt = new DataTable();
    
            SqlCommand comando = new SqlCommand();
            comando.CommandType = CommandType.StoredProcedure;
            comando.CommandText = "Portal.dbo.rel_RelatoriosGerenciais";
    
            dt = comando.BuscarDataTable();
    
            this.storeRelatoriosGerenciais.DataSource = dt;
            this.storeRelatoriosGerenciais.DataBind();
    
            // return dt;
    
        }
    
        [DirectMethod]
        public void onClickButton(object sender, DirectEventArgs e)
        {
            string url = e.ExtraParams["id"];
          
            Response.Clear();
            Response.AddHeader("content-disposition", url);      
            Response.ContentType = "application/octet-stream";
            Response.End();
        }
    }
    Last edited by Daniil; Aug 11, 2015 at 3:37 PM. Reason: [CLOSED]
  2. #2
    any suggestions ?
  3. #3
    Hi @miltonfoti,

    Being a premium member, please ask technical support questions on the Premium forums. Otherwise we might miss your question.

    Yes, it definitely looks like a cache problem. I would recommend to try a cache buster for the URL.
  4. #4
    I thought I was in premiun forum , sorry .


    You could give me an example of cache buster?

    tks
  5. #5
    Please just add something unique to the end of URL. In JavaScript it could look:
    url + "?" + new Date().getTime()

Similar Threads

  1. [CLOSED] File download In MVC
    By matrixwebtech in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 13, 2014, 2:22 PM
  2. Replies: 4
    Last Post: Oct 25, 2014, 1:12 AM
  3. 2.1 zip file download
    By gdog_5021 in forum 2.x Help
    Replies: 4
    Last Post: Dec 03, 2012, 11:14 AM
  4. Download file in MVC project
    By danni in forum 1.x Help
    Replies: 0
    Last Post: Aug 10, 2009, 7:50 AM
  5. File download
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 05, 2008, 7:22 AM

Tags for this Thread

Posting Permissions