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

271
Visualizações
GET <my local path..> ::ERR_UNKNOWN_URL_SCHEME when uploading a local image

I am getting an error in my console every time I upload an image. I'm loading it as Base64. The image uploads successfuly, and I can see the preview but error is there.

The error seems to be displayed asynchronously but I guess it is caused in this function, in the file.ReadAsDataURL method:

export function getBase64FromFile(target) {
    return new Promise((resolve, reject) => {
        let fileReader = new FileReader();

        fileReader.onloadend = fileLoadedEvent => {
            const base64 = fileLoadedEvent.target.result;
            resolve(base64);
        };

        fileReader.onerror = () => {
            reject(fileReader.error);
            console.log('filereader onerror', fileReader.onerror);
            fileReader.abort();
        };

        if (target) {
            fileReader.readAsDataURL(target);
        }
    });
}

Looks like internaly it ends up resolving somehow but the error is annoying me. For example for my path C:/images/autumn.jpg I noticed that the error is:

GET c:%C3%BAkepathutumn.jpg net::ERR_UNKNOWN_URL_SCHEME

I see that the browser changes the route to C:/Fakepath/autumn.jpg for security, but , then where is the slash between Fakepath and autumn?

The error only apears in chrome, in Firefox, no error is shown.

I also tried with adding any sort of prefix as "File:///" in my target, but then It doesn't work.

Any help would be apreciated. Thanks!

about 4 years ago · Juan Pablo Isaza
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