View Single Post
Old 17.06.2019, 19:01
mgpai mgpai is offline
Script Master
Join Date: Sep 2013
Posts: 636

Originally Posted by D.IKE.E View Post
So is it done by changing link.getName to link.getSize or what is the variable?
// Disable download link, if file exists on disk
// Trigger Required: "A Download Started".

var linkName = link.getName();
var folders = ["c:/downloads/1/", "c:/downloads/2/", "c:/downloads/3/"]; // <- Check if file exists in these folders

folders.forEach(function(folder) {
    if (!link.isEnabled()) return;
    var file = getPath(folder + linkName);
    if (!file.exists()) return;
    if (link.getBytesTotal() == file.getSize()) link.setEnabled(false);
Reply With Quote