Search code examples
javascriptnode.jsapidropbox

Download file from public dropbox link to server using node js


Is there any way to download file from anyones dropbox via public link and save it on my server with node js? I need a way without any type of authentication. For example, how can i download a file from given link like this https://www.dropbox.com/s/dr1cit55idwi1m0/english_buisness_message.txt?dl=0


Solution

  • In my case next code worked correctly:

        var link = "https://www.dropbox.com/s/dr1cit55idwi1m0/english_buisness_message.txt?dl=0"
        var firstPart = link.split("=")[0];
        link = firstPart + '=1';
        var myFile = request(link).pipe(fs.createWriteStream('./dist/testtest.txt'));
        myFile.write(resFull.data);
        myFile.end(() => {
            /..here is callback function../
         })