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

200
Views
Archivo de Google Drive al cargar duplicando el mismo nombre

Cuando ejecuto un programa en el script de Google para cargar una imagen desde la URL a la unidad, el programa se ejecuta correctamente. Pero quiero sobrescribir el mismo archivo con el mismo nombre, no varios archivos

Este es mi código :

 function myFunction() { var url ="https://html.com/wp-content/uploads/flamingo.jpg"; var response = UrlFetchApp.fetch(url); console.log(response.getResponseCode()); var blob=response.getAs('image/jpeg'); var folder = "1WnbHBPcYd9S4XwXpcYEMX32k********"; var fileName=decodeURIComponent(url.split("/").pop()); console.log("File named : "+fileName); var file=DriveApp.getFolderById(folder).createFile(blob); // Set the name to the created file after creating it! file.setName("image.jpeg"); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Eliminar archivos antiguos con el mismo nombre

 function myFunction() { var url ="https://html.com/wp-content/uploads/flamingo.jpg"; var response = UrlFetchApp.fetch(url); var blob=response.getAs('image/jpeg'); var folderid = "1WnbHBPcYd9S4XwXpcYEMX32k********"; const folder = DriveApp.getFolderById(folderid); var fileName=decodeURIComponent(url.split("/").pop()); var files = folder.getFilesByName(fileName); while(files.hasNext()) { let file = files.next(); Drive.Files.remove(file.getId()); }//deletes oldfiles with same name var file=folder.createFile(blob); file.setName("image.jpeg"); }
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!