Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
is it possible did not show the upload file list when upload complete when using antd upload

I am using antd 3.x to upload an xlsx file, this is my code:

<Upload {...props} >
    <Button type="primary" shape="round">Import Data</Button>
</Upload>

and this is the props:

   const props = {
      beforeUpload: file => {
        console.log(file.type)
        const isXls = (file.type === 'application/vnd.ms-excel') || (file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
        if (!isXls) {
          message.error('only support Excel');
          return false;
        }
        const isLt2M = file.size / 1024 / 1024 < 2;
        if (!isLt2M) {
          message.error('need less than 2MB!');
          return false;
        }
        return isXls ? true : Upload.LIST_IGNORE;
      },
      name: 'file',
      fileList:[],
      action: 'https://api.example.com/zhuolian/punish/import',
      headers: {
        authorization: JSON.parse(localStorage.getItem('User')).token,
      },
      onChange(info) {
        if (info.file.status !== 'uploading') {
          console.log(info.file, info.fileList);
        }
        if (info.file.status === 'done') {
          if(info.file.response&&info.file.response.resultCode === "200"){
            message.success(`${info.file.name} success`);
            that.handleSearchInfo();
          }else{
            message.error(info.file.response.msg);
          }
        } else if (info.file.status === 'error') {
          message.error(`${info.file.name} failed.`);
        }
      },
    };

what I have tried to define a zero size fileList array int he props, it would not show the file on the UI, but also cause another problem is that the upload could not trigger the upload complete done event. I also tried to clear the fileList in the onChanged events, it also do not work. Is it possible to close the upload file list show when using antd upload component?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda