Пример #1
0
//Uploads only if the given key does not exist
func uploads3fileifnotexists(binpath, binfile, contenttype string, bucket *s3.Bucket) error {
	k, _ := bucket.GetKey(binpath)
	if k == nil {
		//Binary does not exist on s3.. upload it now...
		return uploads3file(binpath, binfile, contenttype, bucket)
	}
	return nil
}
Пример #2
0
//Uploads only if the given key does not exist
func uploads3fileifnotexists(binpath, binfile, contenttype string, bucket *s3.Bucket) error {
	k, _ := bucket.GetKey(binpath)
	if k == nil {
		//Binary does not exist on s3.. gzip and upload it now...
		finalfile, err := gziptotempfile(binfile)
		if err != nil {
			return err
		}
		return uploads3file(binpath, finalfile, "application/x-gzip", bucket)
	}
	return nil
}