Exemplo n.º 1
0
        public async Task <Stream> GetFile(string key)
        {
            try
            {
                Stream fileStream = await _awss3BucketHelper.GetFile(key);

                if (fileStream == null)
                {
                    throw new Exception("File not found");
                }

                return(fileStream);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
Exemplo n.º 2
0
        public async Task <Stream> GetFile(string bucketName, string key)
        {
            try
            {
                Stream fileStream = await _AWSS3BucketHelper.GetFile(bucketName, key);

                if (fileStream == null)
                {
                    Exception ex = new Exception("File Not Found");
                    throw ex;
                }
                else
                {
                    return(fileStream);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }