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

152
Views
How do I display all images in a folder in html?

I have made a node.js server that users can upload images but I can't figure out how to display all of them. They are in a folder called "/uploads". And thanks for any help! If it matters here is my node.js code:

const express = require('express');
const upload = require('express-fileupload');
const path = require('path');
const app = express();
const serverport = 3000;

app.use(upload());

app.get('/', (req, res) => {
  res.sendFile(__dirname + '/index.html');
  console.log("Routes started!");
});

app.post('/', (req, res) => {
  if (req.files) {
    console.log(req.files);
    var file = req.files.file;
    var filename = file.name;
    console.log(filename);

    file.mv('./uploads/' + filename, function (err){
      if (err) {
        res.send(err);
      } else {
        res.sendFile(__dirname + '/uploads');
        res.send("File uploaded! Why not view others");
      });
    };
});

app.listen(serverport, () => {
  console.log('Server started on port ' + serverport + '!');
});
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!