This tool compresses your file using LZString and splits the compressed output into manageable parts for download. Note: For very large files (multiple GBs), browser memory limitations might occur.
For testing purposes, you might want to reduce the chunk size (e.g., 5-10MB) to see the splitting in action with smaller files.
Upload a file to begin.
cat original_file.part1.lz.txt original_file.part2.lz.txt > original_file.compressed.txtOn Windows (CMD):
copy /b original_file.part1.lz.txt + original_file.part2.lz.txt original_file.compressed.txt
Example JavaScript for decompression:
// Assume 'compressedCombinedString' is the concatenated content of all .lz.txt parts
const originalBase64 = LZString.decompressFromBase64(compressedCombinedString);
// To download the original file:
const originalBlob = base64toBlob(originalBase64, 'application/octet-stream'); // Replace 'application/octet-stream' with original MIME type if known
const url = URL.createObjectURL(originalBlob);
const a = document.createElement('a');
a.href = url;
a.download = 'restored_file_name.ext'; // Use original file name
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
// Helper function (e.g., from StackOverflow)
function base64toBlob(base64, mimeType) {
const byteCharacters = atob(base64);
const byteArrays = [];
for (let offset = 0; offset < byteCharacters.length; offset += 512) {
const slice = byteCharacters.slice(offset, offset + 512);
const byteNumbers = new Array(slice.length);
for (let i = 0; i < slice.length; i++) {
byteNumbers[i] = slice.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
byteArrays.push(byteArray);
}
return new Blob(byteArrays, { type: mimeType });
}