Lets say on my local machine in the folder which contains my GAE project I have an images folder.
When I upload the app to the GAE with the correct .yaml information the images folder and its contents will be uploaded.
Now lets say, I'm running the APP online and I upload an image to the image folder now on Google's servers. Now the images folders contents on the web and on my local development machine are different.
My question is this:
Next time I upload the app to GAE, how will the discrepancy between the different contents of the image folder be resolved?
You can't add files to the application like that after deployment. The local file system is read-only to GAE applications.
If you were to upload an image (via a handler you create) when the app is deployed you can't save it in the image folder in your application, you can only save it to the data/blob store. The files you uploaded with your app are static, they cannot be changed either by you or the application outside of the deployment tool. You can read them in, sure, but not write to them once deployed/at all.
So the situation will never arise that a deployed version has different files to the local version - they are always identical.
Related
I have an app created with flutter. At the startup, it takes data from a database saved in the assets. On a click of a button, I would like to invoke a download of another database from an address and make this new database to be permanently saved in the assets folder of my app in order to be usable later
You cannot download something to the assets folder and then use that as your new asset. Assets are bundled and deployed with your app.
You would have to download and store the information/database to a given location using e.g. getApplicationDocumentsDirectory() and then load that database if it exists, otherwise load your assets database.
I am new in development world. I am trying to understand how the Heroku filesystem works.
I did an Express project using multer to upload images.
In production, everything worked well including fetching the images from my static folder.
However, when I did it with React (frontend=React & Backend=Express) the images are not displaying even though console shows no error.
According to my research Heroku says
Heroku filesystem is ephemeral - that means that any changes to the
filesystem whilst the dyno is running only last until that dyno is
shut down or restarted
and that I should use a dedicated file storage service such as AWS S3 (for static files).
How does this apply to my React project since I didn't use it in the Express project?
In production, everything worked well including fetching the images from my static folder.
In fact, it probably didn't.
Files can be saved to Heroku's ephemeral filesystem, and even loaded, but, as you have seen, this isn't permanent. Whenever your dyno restarts the filesystem resets. This happens frequently (at least once per day).
Express vs. React is irrelevant. You should always use something like S3 for user uploads on Heroku.
How may I upload a data file to my Google app engine folder using any standard file transfer protocol e.g. SFTP, WebDav etc.?
This is so I can use a regular desktop file transfer client
So far the only ways I've found are Google proprietary, and web form upload.
GAE's filesystem is readonly, i.e. you can't really make changes to any of the files once the app is deployed.
You can upload your files to GCS by mounting a bucket as a local directory but as you noted that option doesn't seem to be available on Windows.
You could also use gsutil to transfer files to/from the bucket, like that: gsutil cp *.txt gs://my-bucket, even on Windows (see more details here) but if you want a GUI client - just google for gui clients for gcs, many storage browsers i.e. more or less advanced ftp clients seem to support it (see for example Cyberduck, CrossFTP, etc).
I'm developing a web application in which I want to insert users and be able to display files that they upload via a search option. I can get all of the logic that I need sorted and the files uploaded into the correct directory. However, if I insert a new user into the db, the web app cannot find their file in the directory until I restart the server.
How can I make it so that the resources directory of my web app automatically gets refreshed by the server? I'm developing in Java/JSP and using Tomcat as my server.
Thanks!!
I'm guessing you're putting the files into the src/main/resources folder, then it's being packaged into the artifact and then you access them as the classpath resources. Then the next portion of the resources is going to be available after the next packaging.
Instead you should access the Files via usual File System and Absolute or Relative paths.
I've deployed my first GAE application and I am getting "TemplateDoesNotExist" exception at my main page. It feels like my static directory content is not uploaded to GAE.
Isn't it possible that I update (appcfg.py update myapp/) all my files including the static ones and run it standalone on myappid.appspot.com ?
by the way here you can see the problem:
http://pollbook.appspot.com
PS: my app works perfect locally
Your templates should not be stored in a directory that you refer to as "static" in app.yaml. Static directories are for literally static files that will be served to end users by the CDN without changing. These files cannot be read by the templating engine. It works locally because the dev_appserver does not precisely emulate the production server.
Put your templates in a different directory like /templates or something. You do not need to refer to this directory in your app.yaml.