作者 yangfu

修改配置

... ... @@ -89,7 +89,7 @@ func CreateUploadImage(client *vod.Client, r *CreateUploadImageRequest) (respons
}
request.ImageExt = filepath.Ext(r.FileName)[1:]
if !ValidFileExt(ImageFileExt, r.FileName) {
request.ImageExt = "jpeg"
request.ImageExt = "jpg"
}
request.AcceptFormat = "JSON"
//request.StorageLocation = filepath.Base(request.Title)
... ...
... ... @@ -76,9 +76,9 @@ func CreateUploadImage(header *protocol.RequestHeader, request *aliyun.CreateUpl
if len(request.FileName) == 0 {
request.FileName = aliyun.DefaultImageFileName
}
//if !aliyun.ValidFileExt(aliyun.ImageFileExt, request.FileName) {
// return nil, aliyun.OssErrFileFormat
//}
if !aliyun.ValidFileExt(aliyun.ImageFileExt, request.FileName) {
return nil, aliyun.OssErrFileFormat
}
request.Title = utils.GetFileName(header.AppProject, aliyun.FileImage, request.FileName)
rsp, err = aliyun.CreateUploadImage(client, request)
rsp.FileURL = rsp.ImageURL
... ...