You need to sign in to do that
Don't have an account?
Angello Camacho Drago
Delete document after download through visualforce page
I created a visualforce page with a button to download a document, this work fine, but after download the document I want to delete the file without to click in another button, this is the code I am using:
<apex:page standardController="npe03__Recurring_Donation__c" extensions="ReporteCompromisosExportacionController" action="{!getFile}" tabStyle="Reporte_Compromisos__tab">
<apex:form >
<apex:actionFunction name="download" action="{!downloadFile}"/>
<apex:actionFunction name="deletef" action="{!deleteFile}" rerender="name"/>
<apex:pageBlock id="page">
<apex:pageBlockSection columns="1" title="Descargar Archivo de Cobranza" collapsible="false">
<apex:pageBlockSectionItem >
<apex:image url="{!$Resource.excelIcon}" width="30" height="30"/>
<apex:outputText id="name" value="Archivo {!fileName}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons location="bottom">
<apex:CommandButton value="Descargar Archivo" action="{!downloadFile}" oncomplete="deletef();" rerender="name"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
The oncomple method doesn't work, can some one help me please?
Thanks.
<apex:page standardController="npe03__Recurring_Donation__c" extensions="ReporteCompromisosExportacionController" action="{!getFile}" tabStyle="Reporte_Compromisos__tab">
<apex:form >
<apex:actionFunction name="download" action="{!downloadFile}"/>
<apex:actionFunction name="deletef" action="{!deleteFile}" rerender="name"/>
<apex:pageBlock id="page">
<apex:pageBlockSection columns="1" title="Descargar Archivo de Cobranza" collapsible="false">
<apex:pageBlockSectionItem >
<apex:image url="{!$Resource.excelIcon}" width="30" height="30"/>
<apex:outputText id="name" value="Archivo {!fileName}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons location="bottom">
<apex:CommandButton value="Descargar Archivo" action="{!downloadFile}" oncomplete="deletef();" rerender="name"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
The oncomple method doesn't work, can some one help me please?
Thanks.