I am using a dashBoard in my project with the OnbeforeUpload option, but when I click on send, it brings me a length error and does not bring me the statusBar
My code is like this
const beforeUpload = (files: any) => {
const updatedFiles = {};
Object.keys(files).forEach(fileID => {
this.anexoMetadata.idTipo = this.tipoDocumento.value.id;
this.anexoMetadata.sigiloso = this.sigiloso.value;
updatedFiles[fileID] = {
...files[fileID],
meta: files[fileID] = this.anexoMetadata,
};
});
return updatedFiles;
};
my dash
uppy.use(Dashboard, {
inline: true,
replaceTargetContent: true,
height: 200,
width: 413,
note: 'Somente imagens e arquivos (PDF) de at茅 2 MB',
target: '#dash-drag-drop',
showProgressDetails: true,
browserBackButtonClose: true,
disablePageScrollWhenModalOpen: false,
showLinkToFileUploadResult: false,
});
When I use it without onBeforeUpload, it works but can't find my files.
The Dashboard uses a file's meta.name for rendering. This line is probably overwriting meta so that the file name is not there anymore:
meta: files[fileID] = this.anexoMetadata,
(Also, that files[fileID] assignment seems wrong 馃槃 )
This should work instead:
meta: {
...files[fileID],
...this.anexoMetadata
}
damn, thank you very much!
Most helpful comment
damn, thank you very much!