google-cloud-storage

xml is shown instead of site

隐身守侯 提交于 2021-01-01 05:07:02
问题 I am learning google cloud so I tried to deploy my react app there using storage service. For that i created a bucket called travelfrontend and uploaded the files and folders from build folder which is generated when using yarn build . I do not have any domain so i tried to access from https://storage.googleapis.com/travelfrontend but it shows me the following I could not make it live. Did I miss anything to make it live? 回答1: In order to serve the static content generated after running yarn

Copy files from GCS into a Cloud Run docker container during build

白昼怎懂夜的黑 提交于 2020-12-26 12:13:55
问题 I am trying to use gsutil to copy a file from GCS into a Run container during the build step. The steps I have tried: RUN pip install gsutil RUN gsutil -m cp -r gs://BUCKET_NAME $APP_HOME/artefacts The error: ServiceException: 401 Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object. CommandException: 1 file/object could not be transferred. The command '/bin/sh -c gsutil -m cp -r gs://BUCKET_NAME $APP_HOME/artefacts' returned a non-zero code: 1 ERROR

Copy files from GCS into a Cloud Run docker container during build

ぐ巨炮叔叔 提交于 2020-12-26 12:13:37
问题 I am trying to use gsutil to copy a file from GCS into a Run container during the build step. The steps I have tried: RUN pip install gsutil RUN gsutil -m cp -r gs://BUCKET_NAME $APP_HOME/artefacts The error: ServiceException: 401 Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object. CommandException: 1 file/object could not be transferred. The command '/bin/sh -c gsutil -m cp -r gs://BUCKET_NAME $APP_HOME/artefacts' returned a non-zero code: 1 ERROR

Picture being uploaded to Firebase storage using PHP but have to create access token manually to make it visible

徘徊边缘 提交于 2020-12-13 18:46:15
问题 I am using PHP to upload image to firebase storage. the picture is being uploaded but it is not being accessible as i have to manually create " access token " to make it accessible. here is the code im using $bucketName = "example.appspot.com"; $objectName = 'Photos/test.jpeg'; $storage = new StorageClient(); $bucket = $storage->bucket($bucketName); $object = $bucket->upload(fopen('sign.jpeg', 'r'), [ 'name' => $objectName ] ); 回答1: That is indeed working as expected: since your upload is not

How Can I Return Specified Image Size From Google Cloud Storage With Node API?

|▌冷眼眸甩不掉的悲伤 提交于 2020-12-13 04:39:32
问题 I'm using cloud storage and it is working well, I just don't want to return the full-size image every time. I'm wondering if there is a way to specify a width to resize an image to when I request it? Here is the WORKING code. I just need to return smaller images, say, 300px wide (maintaining original aspect ratio). This number could change or fluctuate, so I don't want to save a ton of different versions at different sizes unless I absolutely have to. var fileName = "Image.png"; var stream =

Google cloud storage python client AttributeError: 'ClientOptions' object has no attribute 'scopes' occurs after deployment

自闭症网瘾萝莉.ら 提交于 2020-12-08 05:46:30
问题 I am using cloud storage with App Engine Flex. Out of the blue i start getting this error message after deploy succeeds The error is happening from these lines in my flask app. from google.cloud import storage, datastore client = storage.Client() File "/home/vmagent/app/main.py", line 104, in _load_db client = storage.Client() File "/env/lib/python3.6/site-packages/google/cloud/storage/client.py", line 110, in __init__ project=project, credentials=credentials, _http=_http File "/env/lib

Google cloud storage python client AttributeError: 'ClientOptions' object has no attribute 'scopes' occurs after deployment

半城伤御伤魂 提交于 2020-12-08 05:45:50
问题 I am using cloud storage with App Engine Flex. Out of the blue i start getting this error message after deploy succeeds The error is happening from these lines in my flask app. from google.cloud import storage, datastore client = storage.Client() File "/home/vmagent/app/main.py", line 104, in _load_db client = storage.Client() File "/env/lib/python3.6/site-packages/google/cloud/storage/client.py", line 110, in __init__ project=project, credentials=credentials, _http=_http File "/env/lib

Get public url for object uploaded on cloud storage

独自空忆成欢 提交于 2020-12-06 07:00:23
问题 I uploaded a pdf file on cloud storage. But when i access url https://storage.cloud.google.com/[BUCKET]/[FILE].jpg i am redirected to google signin page. Is there any way to get a public url which gives direct access to file and doesnt have CORS issues. 回答1: It was silly mistake. Use storage.googleapis.com/<bucketName>/<fileName> instead of storage.cloud.google .com/<bucketName>/<fileName> 来源: https://stackoverflow.com/questions/55259932/get-public-url-for-object-uploaded-on-cloud-storage

Creating/Uploading new file at Google Cloud Storage bucket using Python

ぐ巨炮叔叔 提交于 2020-12-01 07:18:48
问题 How to create new empty files in Google Cloud Storage using Python with client libraries available? Or how to upload a new file to a selected bucket using blob function "upload_from_filename()" ? To initialize the blob object we should have file already in the cloud bucket, but I want to create a new file name, and copy the content from the file stored locally. I want to do this using python. Thanks in advance 回答1: First you need to load the library import google.cloud.storage Assuming you

Cloud functions onUpdate: Cannot read property 'forEach' of undefined

五迷三道 提交于 2020-11-29 21:25:37
问题 Now I am trying to update the picture in my project. I could update the picture url in the cloud fire store. But also I want to delete the previous picture from the cloud storage using firebase cloud functions. What I want to achieve is, to delete the previous picture from the cloud storage when I upload the new picture. This is my data structure. I have "sample" field in "Product" collection. When the picture in "sample" field is updated, I want to delete the original picture in the cloud