generated from fahricansecer/boilerplate-fe
main
Some checks failed
UI Deploy (Next-Auth Support) 🎨 / build-and-deploy (push) Has been cancelled
Some checks failed
UI Deploy (Next-Auth Support) 🎨 / build-and-deploy (push) Has been cancelled
This commit is contained in:
13
download.js
Normal file
13
download.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import https from 'https';
|
||||
import fs from 'fs';
|
||||
|
||||
const file = fs.createWriteStream("public/hero-bg.jpg");
|
||||
https.get("https://drive.google.com/uc?export=download&id=1YVWlLN4_6B4aVQ5BMeK72wpJyB4Az5T9", function(response) {
|
||||
if (response.statusCode === 302 || response.statusCode === 303) {
|
||||
https.get(response.headers.location, function(res) {
|
||||
res.pipe(file);
|
||||
});
|
||||
} else {
|
||||
response.pipe(file);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user