Auto-save attachments


Using the Mattermost Windows client, I’d like any attachment in some channels to be auto-saved on the local disk.
Is there an option to do so?

I can set the Download location (Specify where you want files to be downloaded on your machine), but I’ve to download manually the files.

Alternatively, is there a specific location on the disk where Mattermost app saves the file for its own usage, for instance an image in a channel?

Thanks for any help.

Hi and welcome to the Mattermost forums!

The windows desktop app is based on an electron backend and it uses a cache database.
You can check all the directories below %userdata%\appdata\roaming\Mattermost to see if the files you’re looking for are cached there, but I highly doubt they are and if they are, they’re probably in the subdirectories blob_storage or Cache and not in a human readable format.

Can you describe your usecase? Maybe there’s a workaround we could use.

1 Like

Thanks @agriesser for your reply.

I had a look at the folder you specified, and indeed, it seems nothing is in human readbale format.

My use case is to trigger automatic actions with Microsoft Power Automate when a post with an attachment is posted on a channel, for instance, send an email, log to Azure devops tool, etc…

Hmm… I think you could maybe query the SearchFiles API call, not 100% sure if it supports searching for recently uploaded files, though.
You could also search for posts and get fileinfo on a post then afterwards, not sure if this would help with PowerAutomate. The advantage is, that it would not depend on your desktop client running.

You could also maybe directly attach PowerAutomate to your Mattermost database. All posted files are stored in the fileinfo table and you could query for files there based on their createat date:

mm712=# select id,createat,postid,name from fileinfo;
             id             |   createat    |           postid           |                name
 817un7diubdjfr853zqjyyf4eo | 1660276130733 | kupqw8d9hprs7qsu5cku5gfqph | F03TS8P6LE5_WinSCP-5.21.2-Setup.exe
 nsbkmh3pk7n6bp7ufw8rwprz1o | 1660276097841 | pfthdhxa1tnexy919ny8ro6ich | F03TALS0D2R_klugscheisser.PNG
(2 rows)
1 Like