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

539
Views
check file size returns error:Path must be a string without null bytes when check file size

I am trying to check the size of file using file-system package in express js but i will get the following error

Path must be a string without null bytes when check file size

fs.stat(req.files.image.data, function(err, stat) {
            if(err) {
                // handle error
                console.log(err)
            }
            console.log(stat);
        });

However req.files.image returns correct ouptut.

> { name: 'Clocktower_Panorama_20080622_20mb (1).jpg',   data: <Buffer
> ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 48 00 48 00 00 ff e1 00
> 80 45 78 69 66 00 00 4d 4d 00 2a 00 00 00 08 00 05 01 12 00 03 00 00
> 00 01 00 01 ... >,   encoding: '7bit',   mimetype: 'image/jpeg',   mv:
> [Function: mv] }
about 4 years ago · Santiago Trujillo
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!