Check this answer here - it does not require a filename, and I'll bet its much easier to use. I've tried quite a few javascript compression/decompression implementations and have been stung by problems such as limits on size of original data, overall speed, efficiency, and so forth. It is oddly difficult to find a good compression/decompression implementation in javascript, but thankfully this one hasn't failed me yet (and I've used it quite a bit):

Compressing a blob in javascript

The implementation you have currently requires the filename because it is trying to be consistent with the zip, so that you can save it for example to a desktop and open it with your favorite zip utility. It sounds like your challenge is very similar to mine, I needed to save and restore compressed items out of local storage in the browser as well as on the server.

Answer from Matt Mullens on Stack Overflow
🌐
GitHub
gist.github.com › raymondpittman › 11cc82788422d1bddfaa62e60e5ec9aa
Native Javascript, automatically download a BLOB zip file using FETCH without the use of manual triggering clicking a DOM element. Will create a DOM element automatically and set the attribute HREF to a zip file or contents, then download file automatically on HTML file page load. Or also, will work through Node.js or another Fetch compatible Javascript interpreter. · GitHub
Then name the zip file as example.zip. Then simply all you do is within the script tags of a HTML file. function download(url, filename) { fetch(url, { mode: 'no-cors' // NO CORS }).then((transfer) => { return transfer.blob(); // RETURN DATA TRANSFERED AS BLOB }).then((bytes) => { let elm = document.createElement('a'); // CREATE A LINK ELEMENT IN DOM elm.href = URL.createObjectURL(bytes); // SET LINK ELEMENTS CONTENTS elm.setAttribute('download', filename); // SET ELEMENT CREATED 'ATTRIBUTE' TO DOWNLOAD, FILENAME PARAM AUTOMATICALLY elm.click() // TRIGGER ELEMENT TO DOWNLOAD }).catch((error) => { console.log(error); // OUTPUT ERRORS, SUCH AS CORS WHEN TESTING NON LOCALLY }) } download('./example.zip', './output.zip'); // LOCAL DISK - Location - Download
🌐
Mark Heath
markheath.net › post › create-zip-files-in-blob-storage
Creating Zip Files in Azure Blob Storage
November 24, 2025 - To write the zip we'll first of all open a writable stream to the blob using OpenWriteAsync and then use ZipArchive from System.IO.Compression to create the zip archive. Then for each file we want to add, we call CreateEntry to create a new entry in the zip file.
Discussions

file - javascript - zip a Blob with zip.js - Stack Overflow
I need to store a lot of text in WebSQl, so I decided to compress the text with zip.js and store the compressed Blobs. More on stackoverflow.com
🌐 stackoverflow.com
How to save binary data of zip file in Javascript? - Stack Overflow
In handleData, you will then instantiate the Blob object to handle the zip data. More on stackoverflow.com
🌐 stackoverflow.com
c# - generate a Zip file from azure blob storage files - Stack Overflow
I have some files stored in my windows azure blob storage. I want to take these files, create a zip file and store them in a new folder. Then return the path to the zip file. Set permission to the ... More on stackoverflow.com
🌐 stackoverflow.com
Creating a Zip File from Blob Storage Using Python in Azure Databricks
Hello, I am working on a task where I need to create a zip file for multiple files stored in blob storage, without having to read the files again or using local storage. I am using Python in Azure Databricks and would like to leverage its capabilities… More on learn.microsoft.com
🌐 learn.microsoft.com
1
0
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 819493 › blob-to-blob-zip
Blob to Blob ZIP - Microsoft Q&A
April 20, 2022 - An Azure service that stores unstructured data in the cloud as blobs. ... I understand that you want to Zip-compress and copy files from one blob storage to another blob storage.
Top answer
1 of 2
3

Check this answer here - it does not require a filename, and I'll bet its much easier to use. I've tried quite a few javascript compression/decompression implementations and have been stung by problems such as limits on size of original data, overall speed, efficiency, and so forth. It is oddly difficult to find a good compression/decompression implementation in javascript, but thankfully this one hasn't failed me yet (and I've used it quite a bit):

Compressing a blob in javascript

The implementation you have currently requires the filename because it is trying to be consistent with the zip, so that you can save it for example to a desktop and open it with your favorite zip utility. It sounds like your challenge is very similar to mine, I needed to save and restore compressed items out of local storage in the browser as well as on the server.

2 of 2
2

The filename is necessary according to this implementation. It wouldn't be necessary if you were only compressing the data, but zip.js builds zip files, which store files, which must have filenames.

In your original example, zipWriter.add() effectively converts your blob into a new file and adds it to a zip – and the "filename" parameter is the name you want that new file to have.

Here's an example that uses zip.js to add multiple blobs to a zip and then downloads it with FileSaver.js:

function zipBlob() {
    zip.createWriter(new zip.BlobWriter("application/zip"), function(writer) {
        files = ["abcd", "123"];
        var f = 0;

        function nextFile(f) {
            fblob = new Blob([files[f]], { type: "text/plain" });
            writer.add("file"+f, new zip.BlobReader(fblob), function() {
                // callback
                f++;
                if (f < files.length) {
                    nextFile(f);
                } else close();
            });
        }

        function close() {
            // close the writer
            writer.close(function(blob) {
                // save with FileSaver.js
                saveAs(blob, "example.zip");
            });
        }

        nextFile(f);

    }, onerror);
}
🌐
Stuk
stuk.github.io › jszip › documentation › howto › write_zip.html
How to write a file / give it to the user
zip.generateAsync({type:"blob"}) .then(function (blob) { saveAs(blob, "hello.zip"); });
Top answer
1 of 7
41

We have solved this problem (partially) by zipping the files directly to the output stream using the blob streams. This avoids the issue of downloading zipping then sending and avoids the delay while this happens (we used ICSharpZipLib, reference). But it still means routing the stream through the web server:

  public void ZipFilesToResponse(HttpResponseBase response, IEnumerable<Asset> files, string zipFileName)
    {
        using (var zipOutputStream = new ZipOutputStream(response.OutputStream))
        {
            zipOutputStream.SetLevel(0); // 0 - store only to 9 - means best compression
            response.BufferOutput = false;
            response.AddHeader("Content-Disposition", "attachment; filename=" + zipFileName);
            response.ContentType = "application/octet-stream";

            foreach (var file in files)
            {
                var entry = new ZipEntry(file.FilenameSlug())
                {
                    DateTime = DateTime.Now,
                    Size = file.Filesize
                };
                zipOutputStream.PutNextEntry(entry);
                storageService.ReadToStream(file, zipOutputStream);
                response.Flush();
                if (!response.IsClientConnected)
                {
                   break;
                }
            }
            zipOutputStream.Finish();
            zipOutputStream.Close();
        }
        response.End();
    }

The storage service simply does this:

public void ReadToStream(IFileIdentifier file, Stream stream, StorageType storageType = StorageType.Stored, ITenant overrideTenant = null)
    {
        var reference = GetBlobReference(file, storageType, overrideTenant);
        reference.DownloadToStream(stream);
    }
private CloudBlockBlob GetBlobReference(IFileIdentifier file, StorageType storageType = StorageType.Stored, ITenant overrideTenant = null)
        {
            var filepath = GetFilePath(file, storageType);
            var container = GetTenantContainer(overrideTenant);
            return container.GetBlockBlobReference(filepath);
        }
2 of 7
4

Since blob storage is "just" an object store, you would need to download them somewhere (it could be a web/worker role or your local computer), zip them and then reupload the zip file. That's the only way to do it as far as I know.

🌐
Arjen Stolk
arjenstolk.wordpress.com › 2020 › 12 › 02 › zip-azure-blob-files-directly-to-a-zip-file
Zip Azure blob files directly to a zip file in blob storage | Arjen Stolk
December 2, 2020 - access key ...windows.net"; CloudStorageAccount storageAccount = CloudStorageAccount.Parse(storageAccount_connectionString); CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); CloudBlobContainer container = blobClient.GetContainerReference("blobfiles"); CloudBlockBlob zipblob = container.GetBlockBlobReference("zipname.zip"); CloudBlobStream zipstream = await zipblob.OpenWriteAsync(); using (ZipArchive zipArchive = new ZipArchive(zipstream, ZipArchiveMode.Create)) { CloudBlobDirectory dira = container.GetDirectoryReference(string.Empty); BlobResultSegment rootDirFolders = dira
Find elsewhere
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 1838765 › creating-a-zip-file-from-blob-storage-using-python
Creating a Zip File from Blob Storage Using Python in Azure Databricks - Microsoft Q&A
To create a zip file for multiple files stored in Azure Blob Storage without downloading them locally, you can use the azure-storage-blob library along with in-memory file handling.
🌐
De Blob Wiki
deblob.fandom.com › wiki › Zip
Zip | De Blob Wiki | Fandom
March 10, 2025 - Zip evades capture from the INKT Corporation along with the other Underground members Professor, Arty and Bif. He gives Blob mission objectives that involve racing from one part of a level to another. Along the way, Blob must hit all of markers that Zip gives and complete each mission under ...
🌐
GitHub
github.com › eligrey › FileSaver.js › issues › 78
How to create a BLOB / download a ZIP file? · Issue #78 · eligrey/FileSaver.js
April 3, 2014 - caution: zipfile comment truncated error [export_1396562548755.zip]: missing 4025008710 bytes in zipfile (attempting to process anyway) error [export_1396562548755.zip]: attempt to seek before beginning of zipfile (please check that you have transferred or created the zipfile in the appropriate BINARY mode and that you have compiled UnZip properly) I am generating the BLOB for both the CSV and the ZIP from the data response of an AJAX call I make with jQuery.
🌐
GitHub
github.com › Stuk › jszip › issues › 246
Recommended way to add a blob (image e.g.) to a zip in a browser · Issue #246 · Stuk/jszip
October 15, 2015 - It seems blobs are not supported directly. Any suggestions on the most efficient conversion to perform before adding a blob to a zip? (I've tried a FileReader() with readAsDataURL(blob) but it results in a corrupted file in the zip, and ...
Author   MartijnR
🌐
GitHub
github.com › eligrey › Blob.js › issues › 25
How to instance Blob with zip file? · Issue #25 · eligrey/Blob.js
April 22, 2014 - Hi, If the response is byte[] type of zip file by ajax, how to instance Blob please? The code 'new Blob([fileContents], {type: mimeType})' cannot work. The Blob has no content.
🌐
Mozilla Bugzilla
bugzilla.mozilla.org › show_bug.cgi
772434 - Blob support for Zip file contents
Comment on attachment 646344 [details] [diff] [review] Bug 772434, Blob support for Zip file contents - patch - In nsDOMArchiveRequest::GetFilenamesResult(): + JS_FreezeObject(aCx, array); We should check the return value here and throw an error if this call fails (returns false).
🌐
W3C
lists.w3.org › Archives › Public › public-webapps › 2011OctDec › 0567.html
Enable compression of a blob to .zip file from Alfonso Martínez de Lizarrondo on 2011-10-30 (public-webapps@w3.org from October to December 2011)
October 30, 2011 - User picks his data file with <input type=file> 2. JS starts a XHR upload to show a progress bar 3. JS checks that the file is uncompressed, so it creates a zipped blob: var file = input.files[0]; var extension = file.name.match( /\.([^\.]+)\s*$/ )[ 1 ]; if (extension.toLowerCase() != 'zip') file = file.toZip( 'compressed.zip' ); formData.append( file ); etc...
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 1190828 › are-large-zip-files-restricted-from-upload-to-blob
Are large zip files restricted from upload to Blob Storage? - Microsoft Q&A
azcopy copy "C:\pathtolarge\file.zip" "https://mystorageaccount.blob.core.windows.net/mycontainer/largefile.zip" --block-size-mb 1024 --put-md5
🌐
Appeon Community
community.appeon.com › index.php › qna › q-a › create-a-zip-file-from-a-database-blob
CREATE a ZIP file from a database blob - Appeon Community
November 12, 2019 - Also, downloading the file and renaming the extension to .zip does not work because it's not a real zip file, just a compressed file.