作者 yangfu

图片凭证修改

@@ -83,6 +83,10 @@ func CreateUploadImage(client *vod.Client, r *CreateUploadImageRequest) (respons @@ -83,6 +83,10 @@ func CreateUploadImage(client *vod.Client, r *CreateUploadImageRequest) (respons
83 request := vod.CreateCreateUploadImageRequest() 83 request := vod.CreateCreateUploadImageRequest()
84 request.ImageType = "default" 84 request.ImageType = "default"
85 request.Title = r.Title 85 request.Title = r.Title
  86 + if filepath.Ext(r.FileName) == "" {
  87 + err = fmt.Errorf("filename:%v invalid", r.FileName)
  88 + return
  89 + }
86 request.ImageExt = filepath.Ext(r.FileName)[1:] 90 request.ImageExt = filepath.Ext(r.FileName)[1:]
87 request.AcceptFormat = "JSON" 91 request.AcceptFormat = "JSON"
88 //request.StorageLocation = filepath.Base(request.Title) 92 //request.StorageLocation = filepath.Base(request.Title)