How to get a Google GDrive Direct Download Link

//copyright 2017, metadataconsulting.ca //Jquery included in blogger.com $(document).ready(function(){ $(“#gdriveembedbutton”).click(function(){ document.getElementById(“answer”).value=””; var stringURL = document.getElementById(“iframeTextTop”).value.trim(); var strGDrive = “https://drive.google.com/”; var strGDriveFiled = “file/d/”; var strGDriveFiledURL = “https://drive.google.com/file/d/”; var strGDriveOpenIdURL = “https://drive.google.com/open?id=”; var strGDriveOpenId = “open?id=”; var strGDriveEnd = “/view?usp=sharing”; var strGDriveDownload = “uc?export=download&id=”; var download = “”; var validOpenIdURL = false; if (stringURL.indexOf(strGDriveFiledURL)==0 && stringURL.indexOf(strGDriveEnd)>-1){ download = stringURL.replace(strGDriveFiled, ‘uc?export=download&id=’); download = download.replace(strGDriveEnd, ”); document.getElementById(“answer”).value = download; $(‘answer’).val(download); //make sure $(‘#directtest’).html(‘New! Test your direct download link: ‘+ download+’‘); document.getElementById(“iframeTextTop”).value = “”; document.getElementById(“answer”).select(); $(‘answer’).select(); //make sure } else if (stringURL.indexOf(strGDriveOpenIdURL)==0){ download = stringURL.replace(strGDriveOpenId, strGDriveDownload); document.getElementById(“answer”).value = download; $(‘answer’).val(download); //make sure $(‘#directtest’).html(‘New! Test your direct download link: ‘+ download+’‘); document.getElementById(“iframeTextTop”).value = “”; document.getElementById(“answer”).select(); $(‘answer’).select(); //make sure }else{ if (stringURL.indexOf(strGDrive)==-1) alert(‘Not a valid GDrive Shared Link, does not start with https://drive.google.com/. Your URL begins with ‘ + strGDrive); else if (stringURL.indexOf(strGDriveFiledURL)==-1) { if (stringURL.indexOf(strGDriveOpenIdURL)>-1){ //found validOpenIdURL = true; } else { alert(‘Not a valid GDrive Shared Link, does not contain file string as in ‘+ strGDriveFiledURL); } } else if (!validOpenIdURL && stringURL.indexOf(strGDriveFiledURL)>-1 && stringURL.indexOf(strGDriveEnd)==-1) alert(‘Not a valid GDrive Shared Link, does not contain sharing key string as in ‘ + strGDriveEnd); else if (!validOpenIdURL && stringURL.indexOf(strGDriveOpenIdURL)==-1 && stringURL.indexOf(strGDriveOpenId)>-1) alert(‘Not a valid GDrive Shared Link, does not contain sharing open id as in ‘ + strGDriveOpenIdURL); document.getElementById(“answer”).value = “”; } }); });

I get asked all the time to by my clients to provide a way to direct download URL to a file and NOT preview the file in the Google Drive pre-viewer, especially if the file is large. It’s often very confusing for novice users to have preview mode of file, such as PDF files which launch a separate user GDrive interface.

Moreover, if the file is over 100Mb, the preview appears too slowly for most users, and they’ll abandon the file.

GDrive Direct File Download URL Maker

Paste Gdrive Share link below



Text-box will be highlighted so you can copy the full link. To copy, right-click and choose  “Copy” or simply (ctrl-c) to copy link. Note: Entire URL is automatic selected for your convenience.

 



Source: http://metadataconsulting.blogspot.com/

Be the first to comment

Leave a Reply

Your email address will not be published.


*