通过PHP从计算引擎上的LAMP将图像上传到Google云存储 [英] upload images to google cloud storage via PHP from LAMP on compute engine

查看:70
本文介绍了通过PHP从计算引擎上的LAMP将图像上传到Google云存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我可以将图像上传到我的Web服务,并将其存储在永久性磁盘上,但我想将其保存在GCS上的存储桶中.

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.

如果以前做过此事的人或知道使用php上传示例的人,请提供帮助.

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

推荐答案

做到这一点的最佳方法是绕过服务器,让用户将文件直接上传到GCS.它避免了服务器上长时间运行的请求,因此您可以更好地扩展(并节省成本). 开发文档中很好的示例

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

如果您仍然想流式传输服务器,请使用 PHP客户端库

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

这篇关于通过PHP从计算引擎上的LAMP将图像上传到Google云存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆