0

we want to create Contact us page in our website to post contact details from web page to Salesforce and create contact with details just like standard functionality of webtolead. We are able to create contact from web page but also we want to post Attachment as well.

Can anyone please help me how to post attachment from web form Force.com Vf page and how to accept this attachment in Apex controller .Thanks

1

The apex:inputFile element is what you need. There is sample code here:

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_inputFile.htm

But a much more complete and probably more relevant example to your use case is here:

http://blog.jeffdouglas.com/2010/04/22/uploading-a-document-using-visualforce-and-a-custom-controller/

In summary, you create a Document exposed by your custom controller and bind your apex:inputFile to that Document

0

You can use apex:inputFile tag in vf page for this feature.Click here for reference.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.