Download files in vault

Is there any option to fetch/download the stored credential file as a whole file instead of reading the key/vaule pair’s from file?

No, Key values are stored and returned as JSON. What you can do is base64 the file when you submit it and undo the encoding when you retrieve it.

For example, to store this custom secret (a binary file):

$ xxd custom_secret.dat
00000000: 96ae 649f b265 e817 ee04 9478 c358 f556  ..d..e.....x.X.V

Save it in vault with

vault kv put secret/test/custom file=$(base64 custom_secret.dat)

And get it back with

$ vault kv get --field file secret/test/custom | base64 -d | xxd
00000000: 96ae 649f b265 e817 ee04 9478 c358 f556  ..d..e.....x.X.V