function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Soumya sri yaravaSoumya sri yarava 

how to download the pdf from the static Resource, instead of viewing need to download on click with command button

<apex:page >
   
   
<apex:outputLink value="{!URLFOR($Action.Attachment.Download, $Resource.test_pdf)}" target="_blank">Click Here to Download Pdf File</apex:outputLink>
       -->

       <apex:form >
           <apex:commandButton value="Downloadpdf"/>

<apex:outputLink value="{!URLFOR($Resource.test_pdf)}" >Click Here to Download Pdf File</apex:outputLink>

        </apex:form>
        
</apex:page>

hi guys, how to download the pdf file using the static resource in salesforce, instead of viewing need to dowload the file in using the salesforce

thanks and regards
soumya sree
ANUTEJANUTEJ (Salesforce Developers) 
Hi Sowmya,

I see there is an implementation using javascript in the below link can you try checking this:

>> https://cwestblog.com/2014/10/21/javascript-creating-a-downloadable-file-in-the-browser/

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.
Soumya sri yaravaSoumya sri yarava
hi , anutej, 

how to download the pdf file from  the static resource in salesforce , i need to dowload with the command button  please let help me if posible.

thanks and regards
soumya sree