nginx zip package download file

1. When installing  nginx mod_zip module, pay attention to re-specifying other installed modules ngixn needs to be recompiled

2. The java program value is multiple file paths

java code

if (StringUtil.isEmpty(value)) {

throw new AMPException("No key found or empty file list.");

}

if (!develop) {

super.response.setContentType("application/x-download");

super.response.setHeader("X-Archive-Files", "zip");

/ / Determine whether it is a Firefox browser

if(agent.contains("Firefox")){

filename = new String(filename.getBytes("UTF-8"),"ISO-8859-1");

super.response.setHeader("Content-Disposition",String.format("attachment; filename=%s.zip", filename));

}else{

super.response.setHeader("Content-Disposition", String.format("attachment; filename=%s.zip", filename));

}

}

return new ResponseEntity<String>(value, HttpStatus.OK);

 

//value contains the following three parameters,

@Data

private class DLFile {

private long size;

private String url;

private String name;

 

@Override

public String toString() {

return String.format("- %s %s %s\n", this.size, this.url, this.name);

}

}

php reference https://segmentfault.com/a/1190000000621313

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326286506&siteId=291194637