google-cloud-storage

getSignedUrl when using cloud functions

こ雲淡風輕ζ 提交于 2020-07-23 06:45:07
问题 I am trying to get image url so that I can pass it as src in my html. I created functions and would like to send the url in response. I tried the below but I keep getting Error: Cannot sign data without client_email . import * as functions from 'firebase-functions'; import * as admin from 'firebase-admin'; export const getPicURL = functions.https.onRequest( (request, response) => { const storageBucket = admin .storage() .bucket('gs://my-app.appspot.com'); const fileName = 'my-app/pic1.jpg';

getSignedUrl when using cloud functions

南楼画角 提交于 2020-07-23 06:43:20
问题 I am trying to get image url so that I can pass it as src in my html. I created functions and would like to send the url in response. I tried the below but I keep getting Error: Cannot sign data without client_email . import * as functions from 'firebase-functions'; import * as admin from 'firebase-admin'; export const getPicURL = functions.https.onRequest( (request, response) => { const storageBucket = admin .storage() .bucket('gs://my-app.appspot.com'); const fileName = 'my-app/pic1.jpg';

Use of Service account credentials when using Cloud Functions Shell

谁说我不能喝 提交于 2020-07-22 21:32:35
问题 I've just migrated to Cloud Functions 1.0 and am trying out Cloud Functions shell/emulator to run functions locally (using instructions at https://firebase.google.com/docs/functions/local-emulator) One of the functions is using code below to upload a file to cloud storage and then then generate url for it....but am getting following error: SigningError: Cannot sign data without client_email . const bucket = gcs.bucket(bucketName); bucket.upload(localFilePath, {destination: destinationPath})

Firebase Storage - error with uploading png image via Python google-cloud-storage lib

懵懂的女人 提交于 2020-07-21 07:45:48
问题 I'm running web app based on Firebase Realtime Database and Firebase Storage. I need to upload new images to Firebase google bucket every hour via Python google-cloud-storage lib. Here are the docs. My code for image upload (img_src path is correct): bucket = storage.bucket() blob = bucket.blob(img_src) blob.upload_from_filename(filename=img_path, content_type='image/png') Image seem to be uploaded successfully, but when manually viewing it in Firebase Storage, it doesn't load. All the image

Firebase Storage - error with uploading png image via Python google-cloud-storage lib

我怕爱的太早我们不能终老 提交于 2020-07-21 07:45:09
问题 I'm running web app based on Firebase Realtime Database and Firebase Storage. I need to upload new images to Firebase google bucket every hour via Python google-cloud-storage lib. Here are the docs. My code for image upload (img_src path is correct): bucket = storage.bucket() blob = bucket.blob(img_src) blob.upload_from_filename(filename=img_path, content_type='image/png') Image seem to be uploaded successfully, but when manually viewing it in Firebase Storage, it doesn't load. All the image

Granting directory level permissions for Google Cloud Storage REST APIs

旧时模样 提交于 2020-07-21 02:44:25
问题 My aim is to be able to call the Google Storage REST APIs with an OAuth token granting an authenticated Google user the read/write permissions on a directory called "directoryName" inside my storage bucket. So, far I have successfully managed to use the Storage APIs after adding the user to the ACL for the bucket. However, I do not want to grant the user the READ or WRITE permissions on the complete bucket but just on the user's directory inside the bucket e.g. bucket/directoryName. e.g. I

GCloud Upload httplib2.RedirectMissingLocation: Redirected but the response is missing a Location: header

爷,独闯天下 提交于 2020-07-20 07:35:09
问题 I am attempting to upload a small file to gcloud using a simple python program client = storage.Client(project=GCLOUD_PROJECT) bucket = client.get_bucket(GCLOUD_BUCKET) blob = bucket.blob(GCLOUD_FILE_ON_CLOUD) blob.upload_from_filename(GCLOUD_FILE_LOCAL) It had been working until recently and something changed. Now, whenever I upload a file greater than 5MB I get the below error. Files less than or equal to 5MB goes through. The size isn't large enough to implement resumable upload, is it?

GCloud Upload httplib2.RedirectMissingLocation: Redirected but the response is missing a Location: header

元气小坏坏 提交于 2020-07-20 07:35:08
问题 I am attempting to upload a small file to gcloud using a simple python program client = storage.Client(project=GCLOUD_PROJECT) bucket = client.get_bucket(GCLOUD_BUCKET) blob = bucket.blob(GCLOUD_FILE_ON_CLOUD) blob.upload_from_filename(GCLOUD_FILE_LOCAL) It had been working until recently and something changed. Now, whenever I upload a file greater than 5MB I get the below error. Files less than or equal to 5MB goes through. The size isn't large enough to implement resumable upload, is it?

How to read a huge CSV file from Google Cloud Storage line by line using Java?

这一生的挚爱 提交于 2020-07-18 18:54:11
问题 I'm new to Google Cloud Platform. I'm trying to read a CSV file present in Google Cloud Storage (non-public bucket accessed via Service Account key) line by line which is around 1GB. I couldn't find any option to read the file present in the Google Cloud Storage (GCS) line by line. I only see the read by chunksize/byte size options. Since I'm trying to read a CSV, I don't want to use read by chunksize since it may split a record while reading. Solutions tried so far: Tried copying the

How to read a huge CSV file from Google Cloud Storage line by line using Java?

天涯浪子 提交于 2020-07-18 18:52:26
问题 I'm new to Google Cloud Platform. I'm trying to read a CSV file present in Google Cloud Storage (non-public bucket accessed via Service Account key) line by line which is around 1GB. I couldn't find any option to read the file present in the Google Cloud Storage (GCS) line by line. I only see the read by chunksize/byte size options. Since I'm trying to read a CSV, I don't want to use read by chunksize since it may split a record while reading. Solutions tried so far: Tried copying the