Membuat File Langsung Download Google Drive

Di artikel ini, Aurealisa akan membuat tools kedua, entah apa namanya saya namain langsung download google drive :v

Jika anda tertarik untuk membuat tools upload foto secara otomatis, silahkan kunjungi Disini.

Cara membuat File Goolge Drive langsung Download

1. Silahkan kunjungi Drive Saya - Google Drive
2. Upload file kemudian klik kanan dan klik Bagikan

Kemudian Buka Link Download URL Google Drive, dan salinkan file yg telah anda copy.
Membuat File Langsung Download Google Drive

Jika anda ingin membuatnya sendiri pada halaman stastis, ikuti tutorial ini!

Membuat File Goolge Drive langsung Download

1. Salin javascript dibwah ini.
<script>
window.onload = setup;

function setup(){
document.getElementById('button').addEventListener('click', go, false);
}

function go(){
var DocIDfull = document.getElementById('DocID').value;
var DocIDstart = DocIDfull.indexOf('/d/');
var DocIDend = DocIDfull.indexOf('/', DocIDstart+3);
if (DocIDstart == -1){
document.getElementById('Input_span').innerHTML = '<input type="text" id="output" style="background-color:darkred;color:white;width:100%;" value="Error: Invalid URL" readonly>';
return
}
if (DocIDend == -1){
var DocID = DocIDfull.slice(DocIDstart+3)
}
else{
var DocID = DocIDfull.slice(DocIDstart+3, DocIDend)
}
var ID = 'https://drive.google.com/uc?export=download&id=' + DocID;
document.getElementById('Input_span').innerHTML = '<input type="text" onclick="this.select();" id="output" style="width:100%;" value="' + ID + '" readonly>' +
'<hr style="visibility:hidden;height:0">' +
'<font style="font-size: 12px;font-weight: bold;color: #086900;">Tip: Click the output text, then press Ctrl+A,' +
'<br>followed by Ctrl+C to copy it to your clipboard' +
'<br>(Cmd+A and Cmd+C on a mac)</font>';
document.getElementByID('output').select();
}
</script>

Kemudian masukan kode dibawahnya
<font face="Century Gothic, Calibri" size="5">Masukkan URL Sharing Google Drive:</font>
<br>
<input id="DocID" style="width:100%;" type="text">
<br>
<button id="button">Buat Link Download Langsung</button>
<br><br>
<font face="Century Gothic, Calibri" size="5">Output link:</font>
<br>
<span id="Input_span">
<input id="output" style="width:100%;" type="text" readonly="">
</span>

Kemudian simpan dan lihat hasilnya.

Demo

Masukkan URL Sharing Google Drive:


Output link:




Demikianlah artikel Aurealisa mengenai cara membuat file langsung download google drive, semoga bermanfaat.

Add your comment Hide comment