I can't find a option in the ribbon for attaching a document/file to a discussion post in SharePoint 2013, either while creating a new discussion or Editing an existing one.

I know while we have focus on the Body field, we get multiple options like Upload file, Video and Audio and Picture... But all of them basically embed the files/documents into the body Rich-text. We can't view them as separate attachment files.

I have done a migration of Discussions from an external system to SharePoint 2013 using my custom tool. There i was able to attach documents(using Server side APIs) to discussions and those documents are viewed under Attachments field.(see the screenshot below)

enter image description here

Question : Is there some Configuration setting from UI or Powershell which enables the Attachment option on the ribbon ?

Enabling the Attachments option under the Advanced Settings doesn't help.

UPDATE : In the view screen for the above(Edit) screenshot, i see an extra View Properties link also. enter image description here

  • Is this an out of the box NewForm or did you customize it in SPD? – Mike Apr 22 '15 at 18:50
  • Mike, this is the OOTB Edit form. – Amit Tyagi Apr 22 '15 at 18:58

I mean its not OOTB, but you can execute the javascript function UploadAttachment(); in EditForm.

If you want the Attach File Button in the ribbon you have to add a custom action

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="DiscussionAttachmentAction"
    Location="CommandUI.Ribbon"
    RegistrationId="108"
    RegistrationType="List"
    Title="Re-Add an Attachment Button to Discussion Boards">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
          Location="Ribbon.ListForm.Edit.Actions.Controls._children">
          <Button Id="DiscussionAttachmentButton"
            Command="AttachFileDB"
            Image16by16="/_layouts/15/$Resources:core,Language;/images/formatmap16x16.png?rev=23" Image16by16Top="-235" Image16by16Left="-235"
            Image32by32="/_layouts/15/$Resources:core,Language;/images/formatmap32x32.png?rev=23" Image32by32Top="-409" Image32by32Left="-409"
            LabelText="$Resources:core,cui_ButAttachFile;"
            ToolTipTitle="$Resources:core,cui_ButAttachFile;"
            ToolTipDescription="$Resources:core,cui_STT_ButAttachFile;"
            TemplateAlias="o2" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
          Command="AttachFileDB"
          CommandAction="javascript: UploadAttachment();" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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