You need to sign in to do that
Don't have an account?
KIRONKUMARK
How to attach a file in an OBJECT
Hi, Actually I am maintaing employees in one object and my requirement is 'his resume needs to be uploaded individually' How can I achieve this.... Any help will be appreciated Thanks Kiran
Hi
You can create a vf page for uploading the resume.
Try the below code snippet as reference:
...........
Page
..........
<apex:page controller="UploadDoc">
<apex:form>
<apex:sectionHeader title="Upload a Document into Salesforce"/>
<apex:pageblock>
<apex:pageblocksection columns="1">
<apex:inputfile value="{!myimage.body}" filename="{!myimage.Name}" />
<apex:commandbutton value="Save" action="{!Savedoc}"/>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
.............
Controller
.............
public class UploadDoc
{
Public Document mydoc;
Public Document getmyimage()
{
mydoc = new Document();
return mydoc;
}
Public Pagereference Savedoc()
{
mydoc.folderid = UserInfo.getUserId(); // Stores in the currennt users "My Personal Documents" folder
//mydoc.folderid = 'any other id you want here'; // Fetch Id dynamically by using [Select Id from Folder where Name='My Images']. Specifying a FolderId is mandatory
insert mydoc;
return NULL;
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.