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

181
Visualizações
How Discord checks if a Javascript File is a folder on client side?

I notice that Discord can detect if you drop a folder without sending any validation request to a server, all in the client. How can I do that?

When a file is submitted from an <input type="file"> then there is no problem, because it can't select folders, but on a drag-and-drop system you can drop anything and I'm looking for a way to detect folders because it's weird how if you drop a folder, let's say folderExample you get a File object with the property type="", BUT when you drop the same folder with a name like folderExample.jpg now the type is "image/jpeg"!!!

There is how I'm handling the file dropping, hope some can help

const handleDrop = (e) => {
    e.preventDefault();
    e.stopPropagation();
  
    const {files} = e.dataTransfer;
    console.log('Dropped files:', files)
  };
about 4 years ago · Santiago Gelvez
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