waha icon indicating copy to clipboard operation
waha copied to clipboard

[Feature Request] Support uploading Media to MongoDB storage

Open devlikepro opened this issue 1 year ago • 5 comments

If we anyway uses mongodb to save session configuration and authentication, why not saving media there as well?

patron:PRO

devlikepro avatar Aug 21 '24 10:08 devlikepro

Good idea, will the efficiency of requesting this interface be greatly improved? Because downloading media is really slow now /api/{session}/chats/{chatId}/messages/{messageId}?downloadMedia=true

HuangDaHui avatar Aug 22 '24 01:08 HuangDaHui

Hi! We'll add optimization in the /api/{session}/chats/{chatId}/messages/{messageId}?downloadMedia=true in 2024.9.1 release, even without mongodb! Basicly it used to re-download all media, without checking file exists or not, now it won' redownload file if there's already in the filesystem Just make sure to setup the environment properly to save files between container restart https://waha.devlike.pro/docs/how-to/storages/#save-media-files-between-the-container-restarts

patron:PRO

devlikepro avatar Aug 22 '24 04:08 devlikepro

/api/{session}/chats/{chatId}/messages/{messageId}?downloadMedia=true

Hi, I have configured mongodb and set the file cleanup time. Will the files in mongodb be deleted when the time is up? WHATSAPP_FILES_LIFETIME=10800

HuangDaHui avatar Sep 03 '24 09:09 HuangDaHui

Hi! Mongodb doesn't save media files right now, only Local (files) and S3 can be used https://waha.devlike.pro/docs/how-to/storages/

Yes, when mongodb "media" storage is ready - you can configure WHATSAPP_FILES_LIFETIME so it'l remove after that time.

Btw, WHATSAPP_FILES_LIFETIME is not supported in S3, you need to take care of it yourself

patron:PRO

devlikepro avatar Sep 03 '24 10:09 devlikepro

Hi! Mongodb doesn't save media files right now, only Local (files) and S3 can be used https://waha.devlike.pro/docs/how-to/storages/

Yes, when mongodb "media" storage is ready - you can configure WHATSAPP_FILES_LIFETIME so it'l remove after that time.

Btw, WHATSAPP_FILES_LIFETIME is not supported in S3, you need to take care of it yourself

patron:PRO

Okay, for now, I still use local, so I will keep cleaning up regularly. I look forward to you updating the mongodb file saving function.

HuangDaHui avatar Sep 03 '24 10:09 HuangDaHui

MongoDB deprecated, I don't think we'll go this way

patron:PRO

devlikepro avatar May 23 '25 08:05 devlikepro