Are you using Vf page for Opportunity? If you are using Vf page for opportunity then you can copy below code & paste in your org. If you are using for another object then change object name in Vf page (from here: standardController="Opportunity"). After that you can use it according your requirement which object you want to do.
Folllow the below steps: 1.) Copy Vf page & Class Extensions and paste in your org. 2.) Use for your require object & Put VF page on the pageLayout. 3.) It will show on detail page. 4.) Upload your attachment in Vf page section. 5.) It will show in Note & Attachment related list.
Use this vf page & controller for upload attachment.
VF Page:
Controller:
If you have any query please let me know.
if it solves your problem mark as a best anwer.
Thanks,
Arvind kumar
Are you using Vf page for Opportunity? If you are using Vf page for opportunity then you can copy below code & paste in your org.
If you are using for another object then change object name in Vf page (from here: standardController="Opportunity"). After that you can use it according your requirement which object you want to do.
Folllow the below steps:
1.) Copy Vf page & Class Extensions and paste in your org.
2.) Use for your require object & Put VF page on the pageLayout.
3.) It will show on detail page.
4.) Upload your attachment in Vf page section.
5.) It will show in Note & Attachment related list.
Vf Page:
Class Extension:
Please use it. It will work for you.
If you have any issue please let me know.
Thanks,
Arvind Kumar