]> git.ardis.lu - sheets-db/commitdiff
Use the file name property instead of overriding
authorArdis Lu <ardisglu@gmail.com>
Sat, 18 Dec 2021 07:57:23 +0000 (23:57 -0800)
committerArdis Lu <ardisglu@gmail.com>
Sat, 18 Dec 2021 07:57:23 +0000 (23:57 -0800)
query-to-db.html

index 78f77c7c9839db1a67565ac54b2028934d19c56a..d44c95888e95f9da6518c0dfcfec822fb83c8b89 100644 (file)
       google.script.run.withSuccessHandler(query => {
         db.run(query);
         const buffer = db.export();
-        file = new File([buffer], 'database.sqlite3', { type: 'application/vnd.sqlite3' });
+        file = new File([buffer], `${Date.now()}.sqlite3`, { type: 'application/vnd.sqlite3' });
 
         downloadLink.href = URL.createObjectURL(file);
-        downloadLink.download = `${Date.now()}.sqlite3`;
+        downloadLink.download = file.name;
         setState('downloadReady');
       }).generateDatabaseQuery();
     });
This page took 0.03618 seconds and 4 git commands to generate.