b2 icon indicating copy to clipboard operation
b2 copied to clipboard

Supply metadata when uploading file

Open kmarsh opened this issue 9 years ago • 2 comments

Are you planning on adding support to specify custom metadata when uploading a file? (I see FileInfo supports it when reading as CustomMetadata) If not would you accept a PR? I may take a stab at implementing it.

Thanks!

kmarsh avatar Oct 19 '16 22:10 kmarsh

Hey, that sounds like a valid feature to have, thanks. Can you comment a bit on how you expect the API to look like? UploadWithCustomMetadata? I'm not super happy about that not having a WithSHA1 variant, but I also don't want 4 Upload methods...

2016-10-19 15:40 GMT-0700 Kevin Marsh [email protected]:

Are you planning on adding support to specify custom metadata when uploading a file? (I see FileInfo supports it when reading as CustomMetadata) If not would you accept a PR? I may take a stab at implementing it. Thanks! — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub[1], or mute the thread[2].

Links:

  1. https://github.com/FiloSottile/b2/issues/4
  2. https://github.com/notifications/unsubscribe-auth/ABKyTiA_V0U4h1Y20u3iPxLoBZzP_Xv7ks5q1pxdgaJpZM4KbiPG

FiloSottile avatar Oct 19 '16 23:10 FiloSottile

Are you opposed to adding an (optional) parameter to the Upload function? e.g.,

func (b *Bucket) Upload(r io.Reader, name, mimeType string, customMetadata map[string]string) (*FileInfo, error)

kmarsh avatar Oct 20 '16 13:10 kmarsh