Hi Donatas, What's the use case of writing to the public directory? If it is just for writing temporary file (like temporary cache for performance), you can still use other directories (/tmp, /app/otherdir etc). If you want to dynamically update the content in the public directory, unfortunately it won't work, because the files in the local disk are only available to the specific instance, and they are volatile so that when the server restarted for some reason, the files will be lost.
As Jordan said, using Cloud Storage might be a good option. There is a handy GCS stream wrapper <https://github.com/GoogleCloudPlatform/google-cloud-php/blob/master/src/Storage/StreamWrapper.php> available, so you can use the GCS bucket as if they are local directory (of course it's slower than the local disk). On Mon, Apr 24, 2017 at 11:22 AM 'Jordan (Cloud Platform Support)' via Google App Engine <[email protected]> wrote: > Is there a specific reason why you require the need to perform writes to > your 'public/app' folder? Scalable applications in the cloud should > normally never perform writes to the local filesystem, as data written in > an App Engine instance is released with the instance when it is no longer > needed (e.g. when incoming traffic reduces and your App Engine instances > scale down > <https://cloud.google.com/appengine/docs/flexible/php/an-overview-of-app-engine#instance_scaling> > ). > > It is recommended you perform writes to a non-volatile/persistent location > like Google Cloud Storage <https://cloud.google.com/storage/> or the Google > Cloud Datastore <https://cloud.google.com/datastore/> that can be > written/read by your application running in multiple App Engine instances. > You can follow the Reading and Writing Files > <https://cloud.google.com/appengine/docs/standard/php/googlestorage/> > guide for PHP which explains how to use Google Cloud Storage as a wrapper > for reading and writing files in an App Engine PHP app. > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/google-appengine. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-appengine/cbe25784-7636-4b88-9386-e680877f6318%40googlegroups.com > <https://groups.google.com/d/msgid/google-appengine/cbe25784-7636-4b88-9386-e680877f6318%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- -- Takashi -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/CADWEYXg_F0xM3naoMokF9W3kaKJ0Sia18A-BNBOST6VrMfnmMw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
