go build imageServer.go
nohup ./imageServer 1> server.out 2> server.err
执行会自动产生目录
- /static/tools/
- /static/dev/
- /static/live/
- /static/identify/
配置代码在 imageServer.go 文件开头
const(
adomin="localhost:9090"
toolsdir="/static/tools/"
devdir="/static/dev/"
livedir="/static/live/"
identify ="/static/identify/"
)
var form = new FormData();
form.append("uploadfile", "2.png");
form.append("publickey", "公钥");
form.append("secretkey", "秘钥");
var settings = {
"async": true,
"crossDomain": true,
"url": "http://*********/tools/upload",
"method": "POST",
"processData": false,
"contentType": false,
"mimeType": "multipart/form-data",
"data": form
}
$.ajax(settings).done(function (response) {
console.log(response);
});
POST - *********/tools/upload
参数名 | 参数类型 | 描述 | 备注 |
---|---|---|---|
uploadfile | file | # | # |
publickey | string | # | 公钥 |
secretkey | string | # | 秘钥 |
{
"code": 200,
"data": "*********:8080/static/tools/5ee56109-2c07-47bc-9677-caffbce80a89.png",
"msg": "success"
}
这里写备注
POST - *********/dev/upload
参数名 | 参数类型 | 描述 | 备注 |
---|---|---|---|
uploadfile | file | # | # |
publickey | string | # | 公钥 |
secretkey | string | # | 秘钥 |
{
"code": 200,
"data": "*********:8080/static/dev/5ee56109-2c07-47bc-9677-caffbce80a89.png",
"msg": "success"
}
这里写备注
POST - *********/live/upload
参数名 | 参数类型 | 描述 | 备注 |
---|---|---|---|
uploadfile | file | # | # |
publickey | string | # | 公钥 |
secretkey | string | # | 秘钥 |
{
"code": 200,
"data": "*********:8080/static/live/5ee56109-2c07-47bc-9677-caffbce80a89.png",
"msg": "success"
}
这里写备注