作者 yangfu

修改文件权限

@@ -88,6 +88,9 @@ func CreateUploadImage(client *vod.Client, r *CreateUploadImageRequest) (respons @@ -88,6 +88,9 @@ func CreateUploadImage(client *vod.Client, r *CreateUploadImageRequest) (respons
88 return 88 return
89 } 89 }
90 request.ImageExt = filepath.Ext(r.FileName)[1:] 90 request.ImageExt = filepath.Ext(r.FileName)[1:]
  91 + if !ValidFileExt(ImageFileExt, r.FileName) {
  92 + request.ImageExt = "jpeg"
  93 + }
91 request.AcceptFormat = "JSON" 94 request.AcceptFormat = "JSON"
92 //request.StorageLocation = filepath.Base(request.Title) 95 //request.StorageLocation = filepath.Base(request.Title)
93 rsp, err := client.CreateUploadImage(request) 96 rsp, err := client.CreateUploadImage(request)
@@ -76,9 +76,9 @@ func CreateUploadImage(header *protocol.RequestHeader, request *aliyun.CreateUpl @@ -76,9 +76,9 @@ func CreateUploadImage(header *protocol.RequestHeader, request *aliyun.CreateUpl
76 if len(request.FileName) == 0 { 76 if len(request.FileName) == 0 {
77 request.FileName = aliyun.DefaultImageFileName 77 request.FileName = aliyun.DefaultImageFileName
78 } 78 }
79 - if !aliyun.ValidFileExt(aliyun.ImageFileExt, request.FileName) {  
80 - return nil, aliyun.OssErrFileFormat  
81 - } 79 + //if !aliyun.ValidFileExt(aliyun.ImageFileExt, request.FileName) {
  80 + // return nil, aliyun.OssErrFileFormat
  81 + //}
82 request.Title = utils.GetFileName(header.AppProject, aliyun.FileImage, request.FileName) 82 request.Title = utils.GetFileName(header.AppProject, aliyun.FileImage, request.FileName)
83 rsp, err = aliyun.CreateUploadImage(client, request) 83 rsp, err = aliyun.CreateUploadImage(client, request)
84 rsp.FileURL = rsp.ImageURL 84 rsp.FileURL = rsp.ImageURL