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

348
Visualizações
How can I send the modified name for the file uploaded via Uppy?

I can modify the name of the file and it will show it in the console. How can I send this name to the server so the server can use the name? It shows in the console that the files have the updated names, but I cannot get it to send the updated names to the server in the request.

var uppy = new Uppy.Core({
autoProceed: true,
onBeforeFileAdded: (currentFile, files) => {
    console.log(currentFile.data.lastModified);
    datePhotoTaken = currentFile.data.lastModified;
    // Change the file name to the last modified date. This doesn't seem to be coming through the XHR upload process unfortunately.
    const modifiedFile = {
        ...currentFile,
        name: currentFile.data.lastModified + ".jpg"
    }
    return modifiedFile
},
onBeforeUpload: (files) => {
    console.log('updated files', files) // files here have `new-name` and empty `data`
},
restrictions: {
    allowedFileTypes: ['image/*']
}
})

    .use(Uppy.Dashboard, {
    inline: true,
    disableThumbnailGenerator: true,
    showSelectedFiles: false,
    target: '#drag-drop-area',
    height: 250
})
.use(XHRUpload, {
    endpoint: uploadUrl
    
    fieldName: 'my_file',
    limit: limit,
    headers: {
        'clientResize': clientResizeEnabled.toString()
    }
})
uppy.on('complete', (result) => {
console.log('Upload complete! We’ve uploaded these files:', result.successful)
})
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