Google cloud storage error loading - strpos (): empty needle

When uploading a file to Google Cloud Storage (through my application running on the application engine) I get the following warning from PHP

Warning: strpos(): Empty needle in /base/data/home/runtimes/php/sdk/google/appengine/ext/cloud_storage_streams/CloudStorageStreamWrapper.php on line 168

I used <form action="<?php echo $upload_url?>according to the official manual, and then made the main move

$gs_name = $_FILES["uploaded_files"]['tmp_name'];
move_uploaded_file($gs_name, "gs://my_bucket/new_file.ext");

Does anyone know why this is so and can someone help in resolving this issue?

+4
source share
2 answers

The same problem ... It looks like an error in the local (latest) version of the SDK of different code. As a workaround I use copy($_FILES["uploaded_files"]['tmp_name'], "gs://my_bucket/new_file.ext")+ unlink($_FILES["uploaded_files"]['tmp_name']), it works :)

+4
source

- , strpos PHP ( ). $gs_name . , .

PHP Google Cloud Storage HTTP POST PHP :

var_dump($_FILES);

, , , .

+1

Source: https://habr.com/ru/post/1525165/


All Articles