You need to sign in to do that
Don't have an account?
Robert Zentgraf
Upload documents by using button on a custom objects and store it in document folder
Hi,
can please someone help me. I created a visualforce page to upload a document on my custom object. But I have issues with the apex-class. How can be the solution?
VF:
Robert
can please someone help me. I created a visualforce page to upload a document on my custom object. But I have issues with the apex-class. How can be the solution?
VF:
- <apex:page StandardController="Profil__c" 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>
- public with sharing class documentExt {
- public Document document{
- get{
- if (document == null)
- document = new Document();
- return document;
- }
- set;
- }
- public documentExt(ApexPages.StandardController controller) {
- Document d = (Document) controller.getRecord();
- d.folderid = '00lc0000000DyIj'; //special folder
- }
- }
Robert
VF Page code Controller Code