CopyDir 拷贝文件夹
(sourceFile, targetFile string)
| 283 | |
| 284 | // CopyDir 拷贝文件夹 |
| 285 | func (o *Oss) CopyFile(sourceFile, targetFile string) (err error) { |
| 286 | var bucket, _ = o.GetBucket() |
| 287 | sourceFile = strings.TrimLeft(sourceFile, "./") |
| 288 | targetFile = strings.TrimLeft(targetFile, "./") |
| 289 | if _, err = bucket.CopyObject(sourceFile, targetFile); err != nil { |
| 290 | beego.Error("copy", sourceFile, "==>", targetFile, err.Error()) |
| 291 | } |
| 292 | return |
| 293 | } |
| 294 | |
| 295 | // Down2local 下载文件夹下的文件到本地 |
| 296 | func (o *Oss) Down2local(sourceDir, targetDir string) (err error) { |