How to get file path in File storage provider

Hello everyone,

I am looking to get file path from file storage_provider.
But I am not sure how can get file path.
Would be appreciated any help!

Thanks in advance,

Hi @Maksym - should work like this:

yourfile = Store.find(id: 1337) # lookup the file by attributes you have or ID

# => /opt/zammad/storage/fs/2de0/44e8/51a50/dabc4/4c9babd/d3948c8/318b6aea7badeac5f2b91c17360f3877
1 Like

Hello @thorsteneckel

Thanks so much for your reply.
I have another question. I am going to get http link to saved file in Zammad.
Is there any solution for that?


You mean like this?

file_id   = 1
fqdn      = Setting.get('fqdn')
http_type = Setting.get('http_type')
url       = "#{http_type}://#{fqdn}/api/v1/attachments/#{file_id}"

Yeah, thanks a lot!!!