upload a >4mb file to an Azure File Share in 2023 - azure-storage

I need to upload files larger than 4mb to an Azure File Share.
Previously the guidance was to use the Date Movement Library The github page implies it's being abandoned / no longer worked on and the v12 libraries should be used instead, but it looks like the 4mb limit is still in place (see Azure Storage File Shares client library for .NET
What is the current way to upload files >4mb to a file share?

The maximum size of a file that can be uploaded in an Azure File Share is 4 TiB (Reference).
When you upload a file in a File Share, you have to upload them in chunks and the maximum size of each chunk can be 4MiB. I think this is where you are getting confused.
So, to upload a file larger than 4MB, what you would need to do is create an empty file using ShareFileClient.CreateAsync method and specify the size of the file there.
Once that is done, you would need to read the source file in chunks (max chunk size would be 4MB) and call ShareFileClient.UploadAsync method by passing the stream data read from the source file.

Related

Uploading a huge file to s3 (larger than my hard drive)

I'm trying to upload a file to an S3 bucket, but the problem is that the file I want to upload (and also create) is bigger than what my hard drive can hold (I want to store a 500TB file on the bucket)
Is there any way to do so?
The file is generated, so I thought about generating the file as I go while it uploads, but I can't quite figure out how to do it.
Any help is appreciated :)
Thanks in advace
The Multipart Upload API allows you to upload a file in chunks, including on-the-fly content generation... but the maximum size of an object in S3 is 5 TiB.
Also, it costs a minimum of $11,500 to store 500 TiB in S3 for 1 month, not to mention the amount of time it takes to upload it... but if this is a justifiable use case, you might consider using some Snowball Edge devices, each of which has its own built-in 100 TiB of storage.

How chunk file upload works

I am working on file upload and really wandering how actually chunk file upload works.
While i understand client sends data in small chunks to server instead of complete file at once. But i have few questions on this:-
For browser to divide and send whole file into chunks, Will it read complete file to its memory? If yes, then again there will me chances of memory leak and browser crash for big files(say > 10GB)
How cloud application like google drive droopbox handles such big files upload?
If multiple files are selected to upload and all have size grater than 5-10 GB, Does browser keep all files into memory then send it chunk by chunk?
Not sure if you're still looking for answer, I been in your position recently, and here's what I've come up with, hope it helps: Deal chunk uploaded files in php
During uploading, If you can print out the request from the backend, you shall see three parameters: _chunkNumber, _totalSize and _chunkSize, with these parameters it's easy to decide whether this chunk is the last piece, if it is, assemble all of the pieces as a whole shouldn't be hard.
As for javascript side, ng-file-upload has a setting named "resumeChunkSize" where you can enable chunk mode and setup the chunk size.

Generate A Large File Inside s3 with .NET

I would to generate a big file (several TB) with special format using my C# logic and persist it to S3. What is the best way to do this. I can launch a node in EC2 and then write the big file into EBS and then upload the file from the EBS into S3 using the S3 .net Clinent library.
Can I stream the file content as I am generating in my code and directly stream it to S3 until the generation is done specially for such large file and out of memory issues. I can see this code help with stream but it sounds like the stream should have already filled up with. I obviously can not put such a mount of data to memory and also do not want to save it as a file to the disk first.
PutObjectRequest request = new PutObjectRequest();
request.WithBucketName(BUCKET_NAME);
request.WithKey(S3_KEY);
request.WithInputStream(ms);
s3Client.PutObject(request);
What is my best bet to generate this big file ans stream it to S3 as I am generating it?
You certainly could upload any file up to 5 TB that's the limit. I recommend using the streaming and multipart put operations. Uploading a file 1TB could easily fail in the process and you'd have to do it all over, break it up into parts when you're storing it. Also you should be aware that if you need to modify the file you would need to download the file, modify the file and re-upload. If you plan on modifying the file at all i recommend trying to split it up into smaller files.
http://docs.amazonwebservices.com/AmazonS3/latest/dev/UploadingObjects.html

Backup Isolated Storage as whole and recover

I am developing a Windows Phone 7.1 application. The app serializes objects to JSON and saves them to the IsolatedStorageSettings file.
The objects also have images that the user may capture with a camera. These images are saved to Isolated Storage as a jpeg file with the "Extensions.SaveJpeg" method. Images are referenced by a unique ID from the object JSON so they can be loaded from the storage with the object itself or loaded only when needed.
Now that I have this up and running, I would like to create a backup to SkyDrive functionality with recovery.
What I want to ask is how can I simply backup the Isolated Storage as whole, and recover as whole?
I've been thinking if there is a way to (1) generate a zip file containing the whole Isolated Storage, (2) upload that to SkyDrive, (3) downloading from SkyDrive and (4) unzipping it replacing any existing files in the storage.
The steps (2) and (3) I know how to do (instructions found easily by google). I can also do step (1) but with many lines of code. I am seeking for a simple solution to zip the whole storage and recover from it.
I recommend you to use Perst as the local database solution for your windows phone application.It can be imported or exported as xml which you can upload/download to/from SkyDrive or other cloud system.
Home page of Perst:http://www.mcobject.com/perst/

Comparing uncompressed local files to compressed files stored on Amazon S3?

We put hundreds of image files on Amazon S3 that our users need to synchronize to their local directories. In order to save storage space and bandwidth, we zip the files stored on S3.
On the user's end they have a python script that runs every 5 min to get a current list of files, and download new/updated files.
My question is what's the best way determine what is new or changed to download?
Currently we add an additional header that we put with the compressed file which contains the MD5 value of the uncompressed file...
We start with a file like this:
image_file_1.tif 17MB MD5 = xxxx1234
We compress it (with 7zip) and put it to S3 (with Python/Boto):
image_file_1.tif.z 9MB MD5 = yyy3456 x-amz-meta-uncompressedmd5 = xxxx1234
The problems is we can't get a large list of files from S3 that include the x-amz-meta-uncompressedmd5 header without an additional API for EACH one (SLOW for hundreds/thousands of files).
Our most practical solution is have users get a full list of files (without the extra headers), download the files that do not exist locally. If it does exist locally, then do and additional API call to get the full headers to compare local MD5 checksum against x-amz-meta-uncompressedmd5.
I'm thinking there must be a better way.
You could include the MD5 hash of the uncompressed image into the compressed filename.
So image_file_1.tif could become image_file_1.xxxx1234.tif.z
Your user python file which does the synchronising would therefore have the information needed to determine if it needed to go get the file again from S3, and could either strip out the MD5 part of the filename, or maintain it, depending on what you wanted to do.
Or, you could also maintain, on S3, a single file containing the full file list including the MD5 metadata. So the python script just need to fetch that single file, parse that, and then decide what to do.