I am trying to upload files more than 200 MB in Sitecore Content Hub using Blob Storage URLs. For file size 700 MB it is working fine. But for more than 1 GB files, the Azure Blob SAAS URL is getting timed out. Can anyone help me out with how to increase the timeout for Azure Blob storage URLs from Content Hub or any other way to upload.
I am using the below codes.
byte[] buffer = new byte[size];
using (FileStream fs = File.OpenRead(fileName))
{
using (BufferedStream bs = new BufferedStream(fs))
{
while ((bytesRead = bs.Read(buffer, 0, size)) != 0)
{
{
Console.WriteLine("Block #" + blockNumber);
blockNumber++;
string blockIds = $"{blockNumber:0000000}";
string blockId = Convert.ToBase64String(Encoding.UTF8.GetBytes(blockIds));
Console.WriteLine("Bock Id : " + blockId);
HttpClient blockClient = new HttpClient();
blockClient.Timeout = TimeSpan.FromMinutes(30);
var binaryContent = new ByteArrayContent(buffer);
binaryContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
var res1 = await blockClient.PutAsync(uploadLocation + "&comp=block&blockid=" + blockId + "", binaryContent);
Console.WriteLine(res1.ReasonPhrase);
blockList.Add(blockId);
blockListXml += "<Latest>" + blockId + "</Latest>";
Console.WriteLine("Bytes read : " + bytesRead);
};
}
}
blockListXml += "</BlockList>";