Skip to content

Latest commit

 

History

History
49 lines (41 loc) · 1.5 KB

en_doc_index.md

File metadata and controls

49 lines (41 loc) · 1.5 KB

EN Document

filesecurityspringboot

Maven central top Sonatype Nexus (Snapshots) build

Document

中文 | EN

Quick Start

Add Dependency

<dependency>
  <groupId>top.huangliusong2019</groupId>
  <artifactId>filesecurity-spring-boot-starter</artifactId>
  <version>1.1.3-SNAPSHOT</version>
</dependency>

filesecurity-spring-boot-starter has been uploaded to maven repository. Add the dependencies above, and you can successfully block file upload requests by annotating @filesecurityannotation on the methods that need to be intercepted.

Add Annotation

    @FileSecurityAnnotation
    @PostMapping("/file")
    public String starter(@RequestParam("file") MultipartFile file) {
        return "success";
    } 

config

file:
  #prefix black list
  upload-prefix-black-list: ".exe"
  #prefix white list
  upload-prefix-white-list: ""
  #MIME  white list
  uploadMIMEWhiteList: "image/jpeg"
  #MIME black list
  uploadMimeBlackList: ""
  #validate hash value of file
  hashCodeValidate: "MD5"