Trying to upload more then 5 GB data in azure blob - c#

I am trying to upload more than 5 GB files in the azure blob in using blob.PutBlockAsync and blob.PutBlockListAsync in asp.net core but it gives me error blocks not contain more than 50000:
https://prnt.sc/10ntmn3
Could you please let me know how I can upload the large file on the azure blob in the asp.net core project?

Related

How to upload large file using Blazor to WebAPI (C#) and store it into Azure Blob storage

I need to upload a large file(up 4GB) using Blazor.
Please in your answers using the new version of Azure Storage SDK (v12 Azure.Storage.Blobs NuGet package.)
In my case, the old version will not work Azure Storage SDK (v11 WindowsAzure.Storage NuGet package.)
Requirement`
Upload file in Blazor UI
Send that file to the server side via API
Store that file in Azure Blob Storage on the server side.
I try a few ways to do this but I didn't manage it.
Is there any way to do this?
What I tried`
Send the file itself(2GB) to API but out of memory exception (google says do not do this way, bad practice)
2.Cut the file as chunks and send it to API, the first part of sending works but I can't collect them all together as one file and store it in Azure Blob Storage (I will have a memory issue).
If there is a way to store it in Azure Blob for example store the first part of chunks then update that file and write other parts sequentially in one file on Azure Blob not service memory. In the end, I will have one large file in Blob.
If there is a way to store it in Azure Blob for example store the
first part of chunks then update that file and write other parts
sequentially in one file on Azure Blob not service memory.
Yes. This is how Block Blobs work in Azure Storage.
Basically what you will need to do is send chunks (called blocks in Azure Storage) of the data to your API and directly save those chunks in blob storage using BlockBlobClient.StageBlockAsync. There is no need for you to save those chunks in your API. You will need to maintain the block ids of the chunks you are uploading in your Blazor application.
Once all the chunks (blocks) are uploaded, you will need to send the block ids to your API and will need to call BlockBlobClient.CommitBlockListAsync from your API to tell Azure Blob Storage to combine all blocks together to create a blob.
To learn more about creating block blobs by uploading blocks, you may find these links useful:
https://learn.microsoft.com/en-us/rest/api/storageservices/put-block
https://learn.microsoft.com/en-us/rest/api/storageservices/put-block-list

Can we upload/download files from kubernetes pod using c#?

I have one API deployed in kubernetes Pod. We have common persistent volume claim storage and want to upload text or any format file in this location using c# code. A .net core api will perform these operation. I am using IFormFile for file input.
Can we do read/write operations with these pods using c# ?

How to save image on Linux (Debian) using ASP.NET CORE 3

I will have to accomplish this new task, to save images on Linux (Debian) server using ASP.NET Core 3. Any idea how to do that. What are the best practices? Any advice are welcome.
thnx
If the blob you mentioned is azure blob storage, you can take a look the following solutions as per your need.
1.If you want to use asp.net core save images to azure blob storage -> then from blob storage, save it to linux file system.
You can first install this nuget package Microsoft.Azure.Storage.Blob to your asp.net core, and refer to this link for saving images to azure blob storage via code(Note that this code is for this older package WindowsAzure.Storage, you need to modify a little). When the images are stored in azure blob storage, you can use blobfuse to map blob storage to your linux server.
2.If you just want to directly save images from asp.net core to linux server, then you should setup a ftp server in the linux server, then directly save images to that linux via ftp.
Hope it helps.

ASP.NET WebAPI - Upload big files using streaming

I have the following business requirements:
User should be able to upload files (max file size should be 20GB) to ASP.NET MVC web site and then this web site should pass these files to ASP.NET Web API web service and then web api will save these files to hard drive.
The problem is: ASP.NET and IIS have limitations for file size - 2 GB (this is max size).
My questions is: how to implement these requirements? And how to do it in the best way (may be I should use file streaming or divide big files to smaller)?
I will very appreciate for any good detailed advices!
Thanks.

Uploading .doc, .pdf or image file to Windows azure mobile services

Is it possible to upload or download .doc, .pdf or any image file to azure mobile services storage. If possible can anyone please provide me same samples.
if by storage you meant, Azure Blob Storage, yes.
here's some links :
Upload images to Windows Azure Storage by using Mobile Services
Upload File to Windows Azure Blob Storage using Windows Azure Mobile Services

Categories