Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

541
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda