private ObjParameter GetByteFile(MultipartFormDataStreamProvider provider, bool isGetFromBlob, string containerName, string blobName)
        {
            ObjParameter package          = new ObjParameter();
            string       path             = string.Empty;
            string       StandardFilePath = Path.GetRandomFileName();

            if (!isGetFromBlob)
            {
                // This illustrates how to get the file names.
                foreach (MultipartFileData file in provider.FileData)
                {
                    path             = file.LocalFileName;
                    package.filename = file.Headers.ContentDisposition.FileName;
                }

                byte[] FileDecrypted = AESHelper.DescryptAES(System.IO.File.ReadAllBytes(path), Vault.Current.AESKeyBLOB);
                package.byteArr = FileDecrypted;
            }
            else
            {
                byte[] _ByteArray = BlobHelper.DownloadFileToArrayByte(Vault.Current.StorageConnectionString, containerName, blobName, Vault.Current.AESKeyBLOB);
                package.byteArr  = _ByteArray;
                package.filename = blobName;
            }
            return(package);
        }
        private byte[] GetByteFile(IFormFile file, bool isGetFromBlob, string containerName, string blobName)
        {
            var decryptKey = _configuration["AESKeyBLOB"];

            if (isGetFromBlob)
            {
                var storageAccountNameShared      = _configuration["StorageAccountNameShared"];
                var storageAccountKeyShared       = _configuration["StorageAccountKeyShared"];
                var aESSecretKey                  = _configuration["AESSecretKey"];
                var storageSharedConnectionString = $"DefaultEndpointsProtocol=https;AccountName={storageAccountNameShared};AccountKey={AESHelper.DescryptAES(storageAccountKeyShared, aESSecretKey)}";

                return(BlobHelper.DownloadFileToArrayByte(storageSharedConnectionString, containerName, blobName, decryptKey));
            }

            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            byte[] fileContent = null;

            using (var ms = new MemoryStream())
            {
                file.CopyTo(ms);
                fileContent = ms.ToArray();
            }

            //Issue: ko decrypt đc, input file ko phải complete block
            return(AESHelper.DescryptAES(fileContent, decryptKey));
            //return fileContent;
        }