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

168
Views
Unable to access static file in Node express root folder

I am trying to create a file uploader which will store file in stored_images directory as shown below:

/project
  /bin
  /stored_images
  /routes
  /public

After the file has been saved here, I want to send url of the saved file to my front-end javascript. How can I get the url of file in stored in stored_images directory?? Or is there other better way to do this??

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

First tell express where to look for static files.

app.use(express.static('public'))

Then put you images folder in your public folder. Then the url to your images would be the path from within the public folder to your images.

For example /my_images/cool_pic.

about 4 years ago · Santiago Trujillo 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!