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

188
Views
How to complete file pathname using javascript

Is it possible (and how) to create a file path if I know part of file pathname? For example I have file pathname /User/Documents/Italy/Report_123.pdf How to complete pathname if I know there is pdf in folder Italy which contain word Report_ those numbers at the end are dynamic?

I need to complete this task in javascript. Thanks in advance.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

if you're using node.js, you can get all the files from that folder, then you iterate that result array to get the one you want.

import { readdir } from 'fs/promises';


const result = await readdir('C:/User/Documents/Italy');
console.log(result);
about 4 years ago · Juan Pablo Isaza Report

0

use this it may be helps you

var documentName = "Report_123.pdf";    // Use documentName Variable to use other js functions for example - documentName.split("_").
var path = "../User/Documents/Italy/"+documentName;
about 4 years ago · Juan Pablo Isaza Report
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!