upload images to google cloud storage via PHP from

2019-07-24 20:06发布

问题:

Currently I'm able to upload images to my web service and it stores them on the persistent disk but I want to save them in a bucket on GCS instead.

If someone who has done it before or know of examples using php to upload, please help.

回答1:

Best way to do this is to bypass your server and let users upload the files directly to GCS. It avoids long running requests on your server, so you can scale better (and also saves cost). A good working sample is in the dev docs

If you still want to stream through your server, use PHP client library