You need to sign in to do that
Don't have an account?
vinod kumar 364
Enter code here
I need an option in VF page to help me choose a file from salesforce and external computer.
Attaching file to salesforce record how to write a filter in vf page to select salesforce documents and my computer documents
Enter code here
VF Page: <table width="500px" align="center" cellpadding="2" cellspacing="2"> <tr> <td colspan="4" align="center"><font size="3"><b>Upload Documents</b></font><br /> <br /> <br /></td> </tr> <tr><td> </td> <td> <apex:inputFile id="fileToUpload" value="{!fileBody}" filename="{!fileName}" /> </td> <td><apex:outputText value="{!filename}"></apex:outputtext></td> <td> <apex:commandButton value="Upload Attachment" action="{!uploadattachment1}"/> </td> </tr> <tr> <td> </td> <td> <apex:inputFile id="fileToUpload2" value="{!fileBody2}" filename="{!fileName2}" /> </td> <td><apex:outputText value="{!filename2}"></apex:outputtext></td> <td> <apex:commandButton value="Upload Attachment" action="{!uploadattachment2}"/> </td> </tr> <tr> <td> </td> <td> <apex:inputFile id="fileToUpload3" value="{!fileBody3}" filename="{!fileName3}" /> </td> <td><apex:outputText value="{!filename3}"></apex:outputtext></td> <td> <apex:commandButton value="Upload Attachment" action="{!uploadattachment3}"/> </td> </tr> </table> APEX Code: public void uploadattachment1() { if(fileBody != null && fileName != null) { Attachment myAttachment1 = new Attachment(); myAttachment1.Body = fileBody; myAttachment1.Name = fileName; myAttachment1.ParentId = cid; insert myAttachment1; } }
I need an option in VF page to help me choose a file from salesforce and external computer.
Use this code