MCPcopy Create free account
hub / github.com/SwishHQ/spread / UploadFileToR2

Method UploadFileToR2

pkg/cloudflare.go:51–66  ·  view source on GitHub ↗
(ctx context.Context, key string, file []byte)

Source from the content-addressed store, hash-verified

49}
50
51func (s *S3Service) UploadFileToR2(ctx context.Context, key string, file []byte) error {
52 input := &s3.PutObjectInput{
53 Bucket: aws.String(s.bucket),
54 Key: aws.String(key),
55 Body: bytes.NewReader(file),
56 ContentType: aws.String("application/zip"), // Set the content type to application/zip for .zip files
57 }
58
59 // Upload the file to Cloudflare R2 Storage
60 _, err := s.s3Client.PutObject(ctx, input)
61 if err != nil {
62 return err
63 }
64
65 return nil
66}

Callers 1

UploadBundleMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected