无法在与Laravel中的Google Cloud App Engine连接的MySQL上上传图片 [英] unable to upload picture on MySQL connected with google cloud app engine in Laravel

查看:53
本文介绍了无法在与Laravel中的Google Cloud App Engine连接的MySQL上上传图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google云应用引擎上部署了Laravel项目.

I deploy a Laravel project on google cloud app engine.

正在尝试上传图片,该图片将保存在laravel项目的"public/uploads"文件夹中,该图片存储在与Google Cloud App Engine连接的MySQL数据库的产品表中.

Am trying to upload a picture that will save in the 'public/uploads' folder of the laravel project, in product table of MySQL database connected with google cloud app engine.

它在我的本地主机上运行,​​但不在Google云上运行.

It's working on my localhost but not on google cloud.

以下是参考图片:

推荐答案

您无法写入云中的生产服务器.来自: https://cloud.google.com/appengine/docs/standard/php/runtime#filesystem

You cannot write to the production server in the cloud. From: https://cloud.google.com/appengine/docs/standard/php/runtime#filesystem

App Engine应用程序不能:

An App Engine application cannot:

写入文件系统.PHP应用程序可以使用Google Cloud Storage用于存储持久性文件.允许从文件系统读取,并且随该应用程序上传的所有应用程序文件均可用.

write to the filesystem. PHP applications can use Google Cloud Storage for storing persistent files. Reading from the filesystem is allowed, and all application files uploaded with the application are available.

您要使用Google云端存储上传照片.您可以临时写入/tmp 目录,但这不会持久.

You want to use Google Cloud Storage to upload photos. You can write to the /tmp directory temporarily, but that will not persist.

这篇关于无法在与Laravel中的Google Cloud App Engine连接的MySQL上上传图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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