Cannot delete attachment OnPrem2016

Home Forums Classic DFFS Cannot delete attachment OnPrem2016

Tagged: 

Viewing 10 reply threads
  • Author
    Posts
    • #39135

      Hi,
      I’m not able to delete an attachment from the SharePoint List Item. When I click on the delete, I get a delete confirmation, and when I confirm delete, the item gets deleted on the display form.

      But when I reopen the item, the deleted attachment still appears.

    • #39136
      Alexander Bautz
      Keymaster

        DFFS does not really handle the deleting – it is using the built in SharePoint code to delete the attachments. It is hard to tell what could cause this issue without looking at it, but my guess is that is might have to do with the filename having special characters.

        Try opening the developer tools by hitting F12 on your keyboard, select the “Console” and try deleting the file. Do you see any error messages (in red) in the console? – if not, try looking at the network tab and look for any errors there when trying to delete the file.

        Alexander

      • #39137

        This is the only error I get while editing the item. And no errors both on the console or on the network tab at the time of deleting the attachment.

        Attachments:
      • #39139
        Alexander Bautz
        Keymaster

          That one is not related. Do your filename have special (not alpha-numeric) characters?

          Alexander

        • #39140

          These are the item attachments which has the issue. Just that I have another version of the document, I’m trying to remove the previous version. There are no complications on the Attachement title too. PFB.

        • #39142

          Here are the attachments .

          Attachments:
        • #39144
          Alexander Bautz
          Keymaster

            Not sure what could cause it, but you can try opening the developer tools in the browser, select the “Console” and then run the attached code – edit the last line under “HOW TO RUN” and change the list name, itemId and the attachment name.

            Alexander

          • #39153

            This is the outcome while I run the code on console.

            Attachments:
          • #39155
            Alexander Bautz
            Keymaster

              It looks like you haven’t used the correct display name of your list (%20 indicates you copied it from the URL).

              Alexander

            • #39156

              Sorry it was my mistake. Now I can get the message as deleted. But when I close the form and reopen the item, the specified document shows up again.

              Attachments:
            • #39158
              Alexander Bautz
              Keymaster

                You must run the code while in EditForm and then save the form. If you still cannot remove the attachment I’m not sure how to do it.

                You might have better luck running a powershell script. Either check with your IT or us your favorite AI-tool generate the powershell code based on my javascript example.

                Alexander

            Viewing 10 reply threads
            • You must be logged in to reply to this topic.