I've forceI have a Force.com site to create cases for partner portal users.I I want to add the attachment functionality to this page. I am getting the filenotfound exception as soon as i hit this page onon sites.
<apex:outputText value="Attach Document" styleClass="lableText" style="margin: 7px 0px;"/>
<apex:inputFile value="{!fileBody}" filename="{!attachment.name}" id="file" style="border: solid 1px #B1B1B1;margin: 7px 0px; width: 476px;"/>
<apex:outputText value="Note: Max file size for upload is 5MB" style="margin-top: 10px;"/>
<apex:outputText styleClass="inputText">
Note – You will only be able to submit one file on the initial email submission. If you need to attach multiple files on the initial submission, please Zip files accordingly and attach the Zip file in the attach document field. If you try and attach multiple files without zipping them, only the last file selected will be in the attach document field. You will be able to submit multiple files without zipping them once you receive a reply from TE that your initial email request was received.
</apex:outputText>
attachment.ParentId = vcase.Id; attachment.IsPrivate = false; attachment.body = fileBody;
<apex:outputText value="Attach Document" styleClass="lableText" style="margin: 7px 0px;"/><br/>
<apex:inputFile tryvalue="{!fileBody}" filename="{!attachment.name}" id="file" style="border: solid 1px #B1B1B1;margin: 7px 0px; width: 476px;"/><br/>
<apex:outputText value="Note: Max file size for upload is 5MB" style="margin-top: 10px;"/><br/>
<apex:outputText styleClass="inputText">
Note – You will only be able to submit one file on the initial email submission. If you need to attach multiple files on the initial submission, please Zip files accordingly and attach the Zip file in the attach document field. If you try and attach multiple files without zipping them, only the last file selected will be in the attach document field. You will be able to submit multiple files without zipping them once you receive a reply from TE that your initial email request was received.
</apex:outputText>
attachment.ParentId = vcase.Id;
attachment.IsPrivate = false;
attachment.body = fileBody;
try {
upsert attachment;
}
}
Please let me know what i am missing.Is Is it possible to insert the attachments from sites?