I'm trying to create a Page Blob, because I would need random access in the future, although I can upload the file, when I download it the size is different.
I get "file.docx" uploaded, and then downloaded as "file2.docx". The downloaded one is a little bigger, actually its size is rounded to page blob page size, 512 :) In this particular case, Microsoft Word gives me a warning saying the file is corrupt, but I can still open it and the content is what I was expecting.
I got the code example from here: Using Windows Azure Page Blobs and How to Efficiently Upload and Download Page Blobs. I've checked out the code to upload it and the documentation, and apparently your page upload must start on a 512 byte boundary (startingOffset % 512 == 0), and end on a 512 boundary - 1. Then what does happen when I need to upload a file that is not aligned to 512?
For example, if I have a file with 550bytes and I upload it and download it I'll get a file with 1024 bytes, right? What should I do? keep the original file size in the metadata or there is a way to do it right?(or example).
Thanks in advance.
Page blobs are made up of 512-byte pages up to 8 TB in total size and are designed for frequent random read/write operations. Page blobs are the foundation of Azure IaaS Disks.
They are named block blobs because files larger than 100 MB must be uploaded as small blocks, which are then consolidated (or committed) into the final blob. Page blobs are used to hold random-access files up to 8 TB in size.
In summary, the difference between the two storage services is that Azure Blob Storage is a store for objects capable of storing large amounts of unstructured data. On the other hand, Azure File Storage is a distributed, cloud-based file system.
Append blobs are ideal for scenarios such as logging data from virtual machines. Page blobs store random access files up to 8 TiB in size.
Yes, you should "keep the original file size in the metadata". Or consider using block blobs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With