Announcement

Collapse
No announcement yet.

When will uploaded docs be removed after removing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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:	163
Size:	10.8 KB
ID:	108344

    (2) if not immediately removed, when is it removed and is there any settings for this?

  • #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


    • #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


      • #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


        • #5
          https://docs.espocrm.com/administrat...rams/#clean-up
          • cleanupAttachmentsFromPeriod – '3 months' – attachments related to records that were marked as deleted (deleted = 1);

          Comment


          • #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 View Post
            (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


            • #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


              • #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.
              Working...
              X