"Upload attachment to VF page" Code Answer's
You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "Upload attachment to VF page" answered properly. Developers are finding an appropriate answer about Upload attachment to VF page related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like Upload attachment to VF page. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on Upload attachment to VF page.
Upload attachment to VF page
<apex:page standardController="Account" extensions="attachmentsample">
<apex:form >
<apex:sectionHeader title="Upload a Attachment into Salesforce"/>
<apex:pageblock >
<apex:pageblocksection columns="1">
<apex:inputfile value="{!myfile.body}" filename="{!myfile.Name}" />
<apex:commandbutton value="Save" action="{!Savedoc}"/>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
Source: www.forcetree.com
Upload attachment to VF page
public class attachmentsample {
public attachmentsample(ApexPages.StandardController controller) {
}
Public Attachment myfile;
Public Attachment getmyfile()
{
myfile = new Attachment();
return myfile;
}
Public Pagereference Savedoc()
{
String accid = System.currentPagereference().getParameters().get('id');
Attachment a = new Attachment(parentId = accid, name=myfile.name, body = myfile.body);
/* insert the attachment */
insert a;
return NULL;
}
}
Source: www.forcetree.com
All those coders who are working on the Whatever based application and are stuck on Upload attachment to VF page can get a collection of related answers to their query. Programmers need to enter their query on Upload attachment to VF page related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about Upload attachment to VF page for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of Upload attachment to VF page while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "Upload attachment to VF page". Visit this developer's friendly online web community, CodeProZone, and get your queries like Upload attachment to VF page resolved professionally and stay updated to the latest Whatever updates.