What can I use instead of Drive.Files.Insert() function?

Viewed 23

My issue concerns the function Drive.Files.insert(), in fact, my code runs correctly, and at the second or third launch, I get this error :

Exception: API call to drive.files.insert failed with error: Empty response.

I have to save Table into a JSON to use it for the next iterations. But this error stops the process and does not save my JSON.. This is my code right below :

function write_json(table, fileName) {
  // define Files attributes
  var fileN = fileName + ".json"
  fileSets = {
    title: fileN,
    mimeType: 'application/json'
  };

  // write .json file

  blob = Utilities.newBlob(JSON.stringify(table), "application/vnd.google-apps.script+json");
  file = Drive.Files.insert(fileSets, blob);
}

I don't know if it is an error due to the limit of storage ? I've seen a limit of 50MB (my JSON file size is close to this figure) or another kind of error

0 Answers
Related