Google app engine google存储BlobKeyForFile错误
我试图通过谷歌从谷歌存储服务图像 为了做到这一点,我需要创建blob键 我尝试了几种生成密钥的方法,但都出现了错误Google app engine google存储BlobKeyForFile错误,google-app-engine,go,google-cloud-storage,Google App Engine,Go,Google Cloud Storage,我试图通过谷歌从谷歌存储服务图像 为了做到这一点,我需要创建blob键 我尝试了几种生成密钥的方法,但都出现了错误 loc := fmt.Sprintf("/gs/%s/%s", BUCKET, s) applog.Infof(appCtx, "%s", loc) bkey, err := blobstore.BlobKeyForFile(appCtx, loc) if err != nil { gc.JSON(500, model.GenericResponse{500, err.Er
loc := fmt.Sprintf("/gs/%s/%s", BUCKET, s)
applog.Infof(appCtx, "%s", loc)
bkey, err := blobstore.BlobKeyForFile(appCtx, loc)
if err != nil {
gc.JSON(500, model.GenericResponse{500, err.Error()})
return
}
opt := &image.ServingURLOptions{}
u, err := image.ServingURL(appCtx, bkey, opt)
if err != nil {
gc.JSON(500, model.GenericResponse{500, err.Error()})
return
}
// i tried with file extension to
/gs/bucktname/CXlvJUKiTmo9joe6
OBJECT_NOT_FOUND
gs://bucktname/rUAJOYKQbORzOYvs
"description": "API error 6 (images: INVALID_BLOB_KEY)"
gs:/bucktname/MlY77iFNbBca2KCA
"description": "API error 6 (images: INVALID_BLOB_KEY)"
writer.ACL=[]Storage.ACLRule{{{Entity:Storage.AllUsers,Role:Storage.RoleReader}
fmt.Sprintf(“/gs/%s/%s”,bucketName,objectName)
,其中objectName是bucket中文件的路径我现在也有同样的问题。你找到答案了吗?令人困惑的是,它在本地模拟appengine上运行时有效,但在实际应用中失败。