开发者社区> 问答> 正文

访问拖放文件-React JS

我这样做是为了拖放文件。如何访问已删除/上传的文件?文件上传正常。与此同时,我还可以看到文件已成功上传。

const config = {
    name: "file",
    multiple: false,
    action: "https://www.mocky.io/v2/5cc8019d300000980a055e76",
    onChange(info) {
      const { status } = info.file;
      if (status !== "uploading") {
        console.log(info.file, info.fileList);
      }
      if (status === "done") {
        message.success(`${info.file.name} file uploaded successfully.`);
      } else if (status === "error") {
        message.error(`${info.file.name} file upload failed.`);
      }
    }
  }
const Section = props => {
    return (
      <section>
      <div className="email-upload feature-content-right bg-white">
      <div className="col-12 col-md-6 feature-callout-image-pull" />
          <div className="container-fluid">

              <div className="callout-feature-content">
                <h1> Email Parser </h1>
                <Dragger beforeUpload={props.handleBeforeUpload} {...config}>
                  <p className="ant-upload-drag-icon">
                    <Icon type="inbox" />
                  </p>
                <Button type ="primary" className="ant-upload-text">
                  Upload your message!
                </Button>
                </Dragger>
                </div>
              </div>

        </div>
        </section>
    );
  };



export default Section;

展开
收起
垚tutu 2019-12-19 16:34:35 534 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
JavaScript函数 立即下载
Delivering Javascript to World 立即下载
编程语言如何演化-以JS的private为例 立即下载