1

For now I'm able to create signed url for uploading file to gcp storage. Is it possible to create one signed url for many files? Below is Golang implementation for single file:

opts := &storage.SignedURLOptions{
    GoogleAccessID: googleCfg.Email,
    PrivateKey:     googleCfg.PrivateKey,
    Scheme:         storage.SigningSchemeV4,
    Method:         http.MethodPut,
    Expires:        time.Now().Add(168 * time.Hour),
    ContentType:    contentType,
}

url, err := storage.SignedURL(bucketName, folderName+filePath, opts)
if err != nil {
    return "", err
}
Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
  • What do you mean with multiple files? A signed url has a specific object name in it, would these multiple files overwrite the same object every time? I think the premise of the question is weird, but the short answer is probably "no, you can't". – somethingsomething May 20 '22 at 11:03
  • Question is not weird. Maybe I was not prefectly accurate. I want to upload many files and It could be uploaded on different paths. Maybe it is not possible. – Sebastian Pawlaczyk May 20 '22 at 11:37
  • 1
    Signed URLs are object specific. You must create a Signed URL for each object. – John Hanley May 20 '22 at 19:34

0 Answers0