Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
javascript - unzip tar.gz archive in google script

I am trying to unzip the file: [https://wwwinfo.mfcr.cz/ares/ares_vreo_all.tar.gz][1] into google drive folder.

So, I have downloaded the file using google script, but can not properly unzip it. Could you, please, help me with it?

Thank you in advance!

Update: Here is my code

function updateDB() {
  var url = 'https://wwwinfo.mfcr.cz/ares/ares_vreo_all.tar.gz';
  var blob = UrlFetchApp.fetch(url).getBlob();
  var folder = DriveApp.getFolderById('fileid');
  var archive = folder.createFile(blob);
  unzip(archive);
}

function unzip(archive){
  var zipblob = archive.getBlob();
  var uncompressed1 = Utilities.ungzip(zipblob);
}

So I receive the following error:

Exception: Could not decompress gzip.

I guess it does not decompress normally, that is why I am asking if you would know different way [1]: https://wwwinfo.mfcr.cz/ares/ares_vreo_all.tar.gz

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use the Utilities Class to unzip your File.

To unzip the gzip you have to call the ungzip() method:

var textBlob = Utilities.newBlob("Some text to compress using gzip compression");

// Create the compressed blob.
var gzipBlob = Utilities.gzip(textBlob, "text.gz");

// Uncompress the data.
var uncompressedBlob = Utilities.ungzip(gzipBlob);

That's the example provided in the official documentation.

You can also take a look at the answer given to this question that also explains how to use the Utilities Class in combination with Google Drive.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!