Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

350
Views
Download a File in the client's downloads folder (NodeJS)

I have a project in Node where I put a Youtube video URL and then I download it. Now it works, but I have the next problem: when I download a video from another PC (in the same LAN), the video goes to the main PCs downloads folder. For example, i deploy the app in my main pc (PC1), and then I download a video from PC2 (another that is in the same LAN that PC1), this video is downloaded in PC1s downloads folder. This is part of my code:

    const express = require('express');
const router = express.Router(); //EL ENCARGADO DE CREAR LAS RUTAS
//const downloadsFolder = require('downloads-folder');
const path = require('path');
const fs = require('fs')
const ytdl = require('ytdl-core');

router.post('/video-url-upload', async (req, res)=>{
    var downloadFolder = path.join(process.env.USERPROFILE, "/Downloads/");
    console.log(downloadFolder);
    //console.log(downloadsFolder());
 
    const url = req.body.urlsubida;
    
    let nombre = await (await ytdl.getInfo(url)).videoDetails.title;
    const nombre_archivo = nombre + '.mp4';
    console.log(nombre_archivo);
    ytdl(url).pipe(fs.createWriteStream(downloadFolder + nombre_archivo));

    res.send('video.mp4');
})

module.exports = router;

I want the video storage in PC2 downloads folder, but i don't know how I can do it.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!