话不多说 直接上代码
config.SavePathBarcodeZip 为zip服务器保存的路径 我是放在/data/zip
saveZipPath := config.SavePathBarcodeZip+time.Now().Format("2006-01-02 15:04:05")+".zip"
saveZipPath 看上面解释
imageList 为你要放进zip包中的文件地址 我的是png图片 放进去一个数组(这些文件地址我放的是服务器保存的地址,因为我先把这些文件保存在了服务器指定的路径上了)
filemy.ZipFile(saveZipPath,imageList)
//这里把zip包上传到了oss的指定路径 给web返回 可直接下载
urlZip , _ := oss.GoodsBarcodeZip(saveZipPath)
ZipFile方法
func