Skip to main content
Tweeted twitter.com/#!/StackSalesforce/status/308706516301664256
Updating the subject to make it a bit more professional with capitalization
Link
Jesse Altman
  • 19.8k
  • 10
  • 59
  • 103

can Can we insert attachmentsAttachments on a caseCase using sitesForce.com Sites?

Fixing bad grammar and incorrect code formatting
Source Link
Jesse Altman
  • 19.8k
  • 10
  • 59
  • 103

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?

I've force.com site to create cases for partner portal users.I want to add the attachment functionality to this page. I am getting the filenotfound exception as soon as i hit this page on 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;

        try {
            upsert attachment;

}

Please let me know what i am missing.Is it possible to insert the attachments from sites?

I have a Force.com site to create cases for partner portal users. I want to add the attachment functionality to this page. I am getting the filenotfound exception as soon as i hit this page on sites.

<apex:outputText value="Attach Document" styleClass="lableText" style="margin: 7px 0px;"/><br/>
<apex:inputFile value="{!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 it possible to insert the attachments from sites?

Source Link
Keepcalmncode
  • 1.2k
  • 7
  • 20
  • 39

can we insert attachments on a case using sites?

I've force.com site to create cases for partner portal users.I want to add the attachment functionality to this page. I am getting the filenotfound exception as soon as i hit this page on 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;

        try {
            upsert attachment;

}

Please let me know what i am missing.Is it possible to insert the attachments from sites?