You need to sign in to do that
Don't have an account?
hegde_hegdek
How to store attachments using APEX
Hello Friends,
How do i store attachments using APEX,i am using the tag inputfile in visual force,but against
which object type do i store it against.
regards
hegde_hegdek
Use "Document" if you want to store files in the document tab, and use "Attachment" if you want to store files attached to a record; use ParentId to specify which record the attachment is stored against. Please note that it is important to capture the Name, Body and ContentType values or your document may not store correctly or be rendered correctly by a browser when re-downloaded.
See the documentation for apex:inputfile - it shows how to use documents.
Or try http://salesforcecode.com/apex/uploading-a-file-as-a-document-using-visualforce to use inputfile with a Visualforce component.