# Attachment Problem

**URL:** <https://forum.manager.io/t/attachment-problem/12128>\
**Category:** Uncategorized\
**Created:** [October 10, 2017, 4:55pm UTC](https://forum.manager.io/t/attachment-problem/12128 "2017-10-10T16:55:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hitronics](https://avatars.discourse-cdn.com/v4/letter/h/8edcca/32.png) [@hitronics](https://forum.manager.io/u/hitronics)\
**Post date:** [October 10, 2017, 4:55pm UTC](https://forum.manager.io/t/attachment-problem/12128/1 "2017-10-10T16:55:09Z")

</div>

I try today to attach file to purchase invoice size 4 MB then the size of the folder of of manager increased but the problem is when I remove attachment 4 MB form the purchase invoice the size of the folder size not reduced

---

<div class="post-metadata">

**Author:** ![Tut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/tut/32/3286_2.png) [@Tut](https://forum.manager.io/u/Tut)\
**Post date:** [October 10, 2017, 5:15pm UTC](https://forum.manager.io/t/attachment-problem/12128/2 "2017-10-10T17:15:46Z")

</div>

This is not a bug and does in any way affect operation of the program. It is related to when compression of the database occurs.

---

<div class="post-metadata">

**Author:** ![hitronics](https://avatars.discourse-cdn.com/v4/letter/h/8edcca/32.png) [@hitronics](https://forum.manager.io/u/hitronics)\
**Post date:** [October 10, 2017, 7:59pm UTC](https://forum.manager.io/t/attachment-problem/12128/3 "2017-10-10T19:59:25Z")

</div>

Why when remove the attachment, the size of the folder not reduced?

---

<div class="post-metadata">

**Author:** ![Brucanna](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/brucanna/32/1960_2.png) [@Brucanna](https://forum.manager.io/u/Brucanna)\
**Post date:** [October 10, 2017, 8:06pm UTC](https://forum.manager.io/t/attachment-problem/12128/4 "2017-10-10T20:06:34Z")

</div>

Because the programme doesn’t include any file reduction processes.  
The space is left available for the next transactions & attachments.  
If you must reduce the file size, I understand that doing a backup will cause this to occur.

---

<div class="post-metadata">

**Author:** ![ShaneAU](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/shaneau/32/10122_2.png) [@ShaneAU](https://forum.manager.io/u/ShaneAU)\
**Post date:** [October 11, 2017, 2:25am UTC](https://forum.manager.io/t/attachment-problem/12128/5 "2017-10-11T02:25:06Z")

</div>

> [@hitronics](#):
>
> Why when remove the attachment, the size of the folder not reduced?

I assume that the file is still stored in the Manager database, it’s just soft-deleted or not linked to a folder / invoice / etc any more. That would explain why the file size of the business remains unchanged. Internally, Manager is a web application with a database backend - even in Desktop Edition.

You can test @Brucanna’s suggestion. Do a backup of the business, then import that backup. Does the file size lower by 4 MB? Please let us know your experience with this.

[https://www.manager.io/guides/8890](https://www.manager.io/guides/8890)

---

<div class="post-metadata">

**Author:** ![Tut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/tut/32/3286_2.png) [@Tut](https://forum.manager.io/u/Tut)\
**Post date:** [October 11, 2017, 2:35am UTC](https://forum.manager.io/t/attachment-problem/12128/6 "2017-10-11T02:35:11Z")

</div>

This has been explained in the past as the contents being deleted but the SQL database being left at the original size, not a soft delete. When a backup is made, the VACUUM command is run.

---

<div class="post-metadata">

**Author:** ![ShaneAU](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/shaneau/32/10122_2.png) [@ShaneAU](https://forum.manager.io/u/ShaneAU)\
**Post date:** [October 11, 2017, 2:38am UTC](https://forum.manager.io/t/attachment-problem/12128/7 "2017-10-11T02:38:44Z")

</div>

> [@Tut](#):
>
> When a backup is made, the VACUUM command is run.

Thanks for clarifying that. It looks like VACUUM is a SQLite quirk - I’m more familiar with MySQL, and to a much lesser extent PostreSQL.

For those that are interested in reading more: [VACUUM](https://sqlite.org/lang_vacuum.html)

---

<div class="post-metadata">

**Author:** ![lubos](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/lubos/32/62798_2.png) [@lubos](https://forum.manager.io/u/lubos)\
**Post date:** [September 10, 2018, 11:55pm UTC](https://forum.manager.io/t/attachment-problem/12128/8 "2018-09-10T23:55:46Z")

</div>

> [@Tut](#):
>
> When a backup is made, the VACUUM command is run.

The latest version ( 18.9.32) is removing `VACUUM` command from backup process. Mostly because on very large databases (1+ GB) it takes too long.

I’ve put `VACUUM` command on `Businesses` screen and it will run when clicking on database size. I think that’s more elegant anyway.

---

<div class="post-metadata">

**Author:** ![Ealfardan](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/ealfardan/32/63166_2.png) [@Ealfardan](https://forum.manager.io/u/Ealfardan)\
**Post date:** [January 18, 2023, 3:09pm UTC](https://forum.manager.io/t/attachment-problem/12128/9 "2023-01-18T15:09:08Z")

</div>


