public ActionResult GetAttachement(int chainid, long chainindex, int attachementkey, long transactionid, string name)
        {
            if (!AttachementItem.IsNameValid(name))
            {
                return(BadRequest());
            }

            var path = _node.AttachementManager.GetAttachementPath(chainid, (uint)chainindex, attachementkey, transactionid, name);

            return(PhysicalFile(path, "application/octet-stream", AttachementManager.GetAttachementFileName(transactionid, name)));
        }
Exemple #2
0
        public Task <byte[]> GetLocalAttachementData(long transactionId, int attachementKey, string name)
        {
            var path = Path.Combine(AttachementManager.GetAttachementPath(ChainId, ChainIndex, attachementKey), AttachementManager.GetAttachementFileName(transactionId, name));

            return(_storage.ReadFileBytesAsync(path));
        }
Exemple #3
0
 public string GetLocalAttachementPath(long transactionId, int attachementKey, string name)
 {
     return(Path.Combine(_storage.Root.FullName, AttachementManager.GetAttachementPath(ChainId, ChainIndex, attachementKey), AttachementManager.GetAttachementFileName(transactionId, name)));
 }