正在显示
1 个修改的文件
包含
4 行增加
和
0 行删除
@@ -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) |
-
请 注册 或 登录 后发表评论