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
anjisalesforce@gmail.comanjisalesforce@gmail.com 

How to Find Attachment Object

Hi all,

 

How to Find the Attachment object.....................

 

 

Thanking you,

Anjireddy

SrikanthKuruvaSrikanthKuruva

in which case do you want to find the attachment object

dcarmen66dcarmen66

Can you please provide more details on what your question is? Thanks!

anjisalesforce@gmail.comanjisalesforce@gmail.com

Hi,

 

I have to take one" <apex:input file>" in Registration form .............

 

i have to upload image ...that image will be save to Documents ...................

 

 

Can u please help for code me 

 

 

Thank you,

Anjireddy

SrikanthKuruvaSrikanthKuruva
<!-- Upload a file and put it in your personal documents folder-->
<!-- Page: -->
<apex:page standardController="Document" extensions="documentExt">
<apex:messages />
<apex:form id="theForm">
<apex:pageBlock>
<apex:pageBlockSection>
<apex:inputFile value="{!document.body}" filename="{!document.name}"/>
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
/*** Controller ***/
public class documentExt {
public documentExt(ApexPages.StandardController controller) {
Document d = (Document) controller.getRecord();
d.folderid = UserInfo.getUserId(); //this puts it in My Personal Documents
}
}

 

ashish raiashish rai

Hey you have to simply write below code . For more details go through this link:

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_inputFile.htm

 

<apex:page standardController="Document" extensions="documentExt">
<apex:messages />
<apex:form id="theForm">
<apex:pageBlock>
<apex:pageBlockSection>
<apex:inputFile value="{!document.body}" filename="{!document.name}"/>
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
/*** Controller ***/
public class documentExt {
public documentExt(ApexPages.StandardController controller) {
Document d = (Document) controller.getRecord();
d.folderid = UserInfo.getUserId(); //this puts it in My Personal Documents
}