When will uploaded docs be removed after removing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • murugappan
    Active Community Member
    • Aug 2017
    • 467

    When will uploaded docs be removed after removing

    Hi,

    We have legal requirements from our clients who want the uploaded documents for a record to be removed from our system. Need information on:

    (1) Is the document removed immediately when we click the "X" in the following input:

    Click image for larger version

Name:	Uploads.png
Views:	198
Size:	10.8 KB
ID:	108344

    (2) if not immediately removed, when is it removed and is there any settings for this?
  • rabii
    Active Community Member
    • Jun 2016
    • 1250

    #2
    AFAK when the document is removed, then as all data record in the system it is marked as deleted in database (will be removed forever when clean up job is triggered each 3 months - this can be configured). However the physical file is not removed from the upload directory. I could be wrong but this what i know.
    Rabii
    Web Dev

    Comment

    • esforim
      Active Community Member
      • Jan 2020
      • 2204

      #3
      If I remember from Yuri post, all 'orphan' file get deleted and remove.

      Of course it just standard delete I think, which is still recovery from data recovery until that part of the Harddrive get overwritten.

      Orphan file are not link to any parent or attachment I think, the logic of it you have to probably read the code on the criteria.

      Comment

      • khopper
        Senior Member
        • Sep 2017
        • 329

        #4
        I am also interested in this, does Espo delete the actual file from the UPLOAD folder when doing clean up? I cannot find a clear and definitive answer.

        Comment

        • yuri
          Member
          • Mar 2014
          • 8443

          #5
          https://docs.espocrm.com/administrat...rams/#clean-up
          • cleanupAttachmentsFromPeriod – '3 months' – attachments related to records that were marked as deleted (deleted = 1);
          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

          Comment

          • victor
            Active Community Member
            • Aug 2022
            • 728

            #6
            does Espo delete the actual file from the UPLOAD folder when doing clean up? I cannot find a clear and definitive answer.
            Originally posted by murugappan
            (1) Is the document removed immediately when we click the "X" in the following input:

            Click image for larger version  Name:	Uploads.png Views:	131 Size:	10.8 KB ID:	108344

            (2) if not immediately removed, when is it removed and is there any settings for this?
            Specifically, in this example, the file will be deleted immediately from your_instance_name/data/upload, but in your database this file will remain with the mark deleted = 1.

            By default, your file will be deleted from the database after 15 days (cleanupAttachmentsPeriod is 15 days). Alternatively, you can set a custom value for the cleanupAttachmentsPeriod parameter in your_instance_name/data/config.php.​​
            Last edited by victor; 10-22-2024, 09:25 AM. Reason: This tip applies to a file that has been added and then removed from a file type field

            Comment

            • murugappan
              Active Community Member
              • Aug 2017
              • 467

              #7
              victor as you stated the attachment may be deleted immediately and database may purge the pointer record(need to verify). However if the Case (in our instance) which uploaded the attachment is not deleted and the case record is accessed, our log is filled with this message:

              Code:
              ERROR: (403) GET /emascrm/; line: 86, file: /home/crmemast/public_html/emascrm/application/Espo/EntryPoints/Attachment.php [] []

              Comment

              • victor
                Active Community Member
                • Aug 2022
                • 728

                #8
                murugappan,

                I misinformed you a bit: my advice in the previous message was NOT about the Attachment type field, but about the File type field.

                If we return to your specific situation, where we are talking about the Attachment field type, then your file "MHK:24:0031568.pdf" will remain in Administration > Attachments and in the /data/upload folder until you yourself delete this file from Administration > Attachments.
                And after that, "MHK:24:0031568.pdf" will remain with the mark deleted = 1.
                And after that, the cleanupAttachmentsPeriod parameter will start working. And depending on the value of this parameter, the Attachment "MHK:24:0031568.pdf" will be deleted from your database.

                Regarding your error, you should check the permissions on your server: https://docs.espocrm.com/administrat...n/#permissions, as I can't reproduce a similar error. It is better to create a separate topic for it (certainly in detail by painting the steps of reproduction).
                Last edited by victor; 10-22-2024, 10:30 AM.

                Comment


                • murugappan
                  murugappan commented
                  Editing a comment
                  victor thank you for responding and advice. Its ok. We made some mistakes. We deleted the physical pdf file on disk before doing a "Delete" of the attachment using the Administration function. The attachment may still remain un-deleted in the DB table.

                • victor
                  victor commented
                  Editing a comment
                  If you have a list of similar files that were deleted from the /data/upload folder and not through the UI, you can delete them directly from the database. The main thing is not to delete other files that remain "alive". After that, make Rebuild.
                  In the future, any deletions should be done primarily through the UI.

                • murugappan
                  murugappan commented
                  Editing a comment
                  victor thank you for the advice. I have noted that will be careful the next time. Only one problem. Under Administration, when we delete the attachment it does not show status of the attachment anywhere. So we do not which ones we have deleted (the ones that are yet to be removed at the back-end). If we can see that we can locate the parent record and fix this.
              • victor
                Active Community Member
                • Aug 2022
                • 728

                #9
                murugappan,

                Under Administration, when we delete the attachment it does not show status of the attachment anywhere
                You will not see deleted records in the UI unless immediately after deletion. On the example of the Attachment file:
                - go to record and delete​ #Attachment/view/6749a30ebd345042e

                Click image for larger version

Name:	image.png
Views:	23
Size:	32.9 KB
ID:	112665
                ​- through Backspace, we return to the record and see that it is crossed out, which means deletion:

                Click image for larger version

Name:	image.png
Views:	134
Size:	31.4 KB
ID:	112664

                In general, it is more convenient to analyze deleted records through phpMyAdmin.

                Comment


                • murugappan
                  murugappan commented
                  Editing a comment
                  victor thank you so much for the advice.
              Working...