Wednesday, 7 August 2019

Uploading files to Google Cloud Compute Engine VM

I recently created sample_service_hosting project that I was planning to deploy to Google Cloud Compute Engine VM running Debian Linux. See blog post "Sample .Net Core Service Hosting". Now I will look into ways to upload files to VM. 

I will describe here a couple of ways to upload files to VM.

1. Upload file using browser window 'Upload file' menu


I normally use 'Browser Window' to access command line on Linux VM. It has menu option 'Upload file', which will upload selected file to your user home directory. Unfortunately, it is very slow way of getting file to VM.

2. Upload file using 'Storage Buckets'


Storage Buckets are the basic containers that hold your data. Everything that you store in Cloud Storage must be contained in a bucket. You can use buckets to organize your data and control access to your data. To upload file to Storage Bucket we will use gsutil tool.

gsutil cp [filename] gs://[DESTINATION_BUCKET_NAME]/

To download file from Storage Bucket run

gsutil cp gs://[BUCKET_NAME]/[filename] [SAVE_TO_LOCATION_PATH]

References


No comments:

Post a Comment