TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
bidzina goginashvili
NA
28
466
Why my blob is broken when I download it?
Sep 3 2020 2:18 PM
So what I am doing is uploading video chunk by chunk with PutBlock. The requester sends me the video divided by 4mb chunks by per request(if the video is 17mb requester will send 5 requests, to upload 4mb chunk). I am using PutBlock method to "append" blob... When I download this video from blob it is broken... But if the requester sends me only 3mb video it is not broken(in 3mb video I mean full video and not splitted by chunks)...
Please help...
public
async Task<CloudBlockBlob> AppendBlobOnAssetAsync(UploadRequest request)
{
using
Stream stream =
new
MemoryStream();
request.File.CopyTo(stream);
stream.Position = 0;
var cloudBlobContainer =
new
CloudBlobContainer(request.InputAssetStorageUri);
var blockBlob = cloudBlobContainer.GetBlockBlobReference(request.BlobName);
var blockItems =
new
List<ListBlockItem>();
var blockItemIds =
new
List<
string
>();
if
(request.BlockId > 0)
{
var blocks = await blockBlob.DownloadBlockListAsync();
blockItems = blocks.ToList();
blockItemIds = blockItems.Select(blockItem => blockItem.Name).ToList();
}
var blockId = Convert.ToBase64String(Encoding.UTF8.GetBytes(request.BlockId.ToString(CultureInfo.InvariantCulture).PadLeft(30,
'0'
))); blockBlob.PutBlock(blockId, stream,
null
); blockItemIds.Add(blockId); blockBlob.PutBlockList(blockItemIds);
return
blockBlob;
}
Reply
Answers (
1
)
How to respond in header with 401 API C # code
How to use “contentent disposition attachment” in OpenXml?