Here is the code for creating the opportunity attachment page in visual force page.
From the developer console choose file new.
Select Visualforce Page and insert the code.
Save the file as UploadOpportunityAttachment.vfp
<apex:page standardController="Opportunity" tabStyle="Opportunity" extensions="UploadOpportunityAttachmentController">
<apex:sectionHeader title="{!Opportunity.Name}" subtitle="Attach File"/>
<apex:form id="form_Upload">
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton action="{!back}" value="Return to {!Opportunity.Name}"/>
<apex:commandButton action="{!back}" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageMessages />
<apex:pageBlockSection columns="1">
<apex:pageBlockSectionItem >
<apex:outputLabel value="File" for="file_File"/>
<apex:inputFile id="file_File" value="{!fileBody}" filename="{!fileName}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="Is the file for COMIT?" for="visible"/>
<apex:selectList value="{!selectedComit}" size="1" id="visible">
<apex:selectOption itemValue="false" itemLabel="No"/>
<apex:selectOption itemValue="true" itemLabel="Yes"/>
</apex:selectList>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="Subject" for="Subject"/>
<apex:inputTextarea id="subject" value="{!subject}" rows="1" cols="75"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="Type" for="type"/>
<apex:selectList value="{!selectedType}" size="1" id="type">
<apex:selectOption itemValue="Contracts" itemLabel="Contracts"/>
<apex:selectOption itemValue="email" itemLabel="email"/>
<apex:selectOption itemValue="Expedited" itemLabel="Expedited"/>
<apex:selectOption itemValue="Finance" itemLabel="Finance"/>
<apex:selectOption itemValue="Legal" itemLabel="Legal"/>
</apex:selectList>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="" for="uploadBtn"/>
<apex:commandButton id="uploadBtn" value="Attach File" action="{!processUpload}" />
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>