I want to create a media storage apps, that allows user to upload and view their media on my platform. I use laravel to create it. I was successfully upload it to google cloud storage with private file attribute, and save the file name to my database. My question is, how to access it directly ..
My needs are simple… One would think. I’m just trying to create a signed URL with a PHP script to prevent download abuse of a file hosted on Google Cloud Storage. I’ve found several examples, none that worked. This one came the closest: <?php $filepath = ‘my file.zip’; // do not include the bucket name, ..
I’m trying to delete a folder in a GCP bucket using the gs storage PHP library. The folder structure is like so -Folder1 –Folder1.1 —File —File –Folder1.2 —File -Folder2 –Folder2.1 —File —File –Folder2.3 —File Hopefully, that makes sense. If not, I basically just need to delete a folder and all files and folders within it. ..
I’m having problems getting Google Cloud batch operations authenticated, using the PHP library. I specifically am trying to do batch deletion of Cloud Storage objects. I am setting things up like so: use GoogleCloudStorageStorageClient; $config = [ ‘projectId’ => <MY Project ID> ‘keyFile’ => json_decode(file_get_contents( <my json key file> ), true) ]; $google_client = new ..
I’m trying to set up batch deleting of GoogleCloudStorage objects. After $config = [ ‘projectId’ => <MY Project ID> ‘keyFile’ => json_decode(file_get_contents( <my json key file> ), true) ]; $google_client = new Google_Client($config); $google_client->setUseBatch(true); $delete_batch_storage_client = new Google_Service_Storage($google_client); $delete_batch = new Google_Http_Batch($google_client, false, NULL, "batch/storage"); $storage_client = new StorageClient($config); $bucket = $storage_client->bucket(<my bucket name>); $params ..
I have a php project here that I want to run in Google Cloud Run, since it also works with files, I thought it makes sense to start a GSC instance and put files there. Locally this has also worked so far. However, as soon as I run the project in Cloud Run, I get ..
I am trying to create a pub/sub notification using PHP. I have a project and a service account. My code looks like: use GoogleCloudCoreIamPolicyBuilder; use GoogleCloudPubSubPubSubClient; use GoogleCloudStorageStorageClient; self::$storage_client = new StorageClient( [ ‘projectId’ => "MY PROJECT ID", ‘keyFile’ => json_decode(file_get_contents("PATH TO MY KEYFILE", true) ] ); $pubSub = new PubSubClient( [ ‘projectId’ => "MY ..
I’m displaying custom data dashboard with the new Google Analytics Data API (GA4). The request output is correct but really slow.. require ‘./vendor/autoload.php’; use GoogleCloudStorageStorageClient; use GoogleAnalyticsDataV1betaBetaAnalyticsDataClient; use GoogleAnalyticsDataV1betaDateRange; use GoogleAnalyticsDataV1betaDimension; use GoogleAnalyticsDataV1betaMetric; putenv(‘GOOGLE_APPLICATION_CREDENTIALS=1_cms_main_conf/google_service_account.json’); $property_id = $conf[‘idAnalytics’]; $client = new BetaAnalyticsDataClient(); $dailyStat = $client->runReport([ ‘property’ => ‘properties/’ . $property_id, ‘dateRanges’ => [ new DateRange([ ‘start_date’ ..
So, I have a GKE-based function that does processing on an image file. I want this function to be triggered whenever a new file gets dumped into a bucket, using Pub/Sub. I have an external system that pushes the image file into the bucket. I was using object notifications to do this, now I want ..
I’ve been working on a system that uploads formData() with appended files to a GCP cloud storage bucket through an XHR PUT request and with Content-Type multipart/form-data, using a signed URL. After the multipart/form-data file is uploaded, I retrieve it using a GCP Storage URI (gs://) on the PHP backend but I’m stuck on decoding ..