Google Bucket remote load settings

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
crash
User
Posts: 169

Google Bucket remote load settings

Post by crash »

I am trying to setup load files to Google Bucket.. It looks like there are 3 places to set file settings, so I have 3 questions.
I have read all the help files and tried entering and testing all of them, although the file loads fine remotely and I can see the image, that file is not loading to my bucket.

  1. In the advanced settings for remote file loading to google bucket.. This is what's stated..
    Google Storage credential file (.json) Use with Google Cloud. Specifies the downloaded credential file (.json) on your PC.
    Question : Must this be the file location on the drive eg: C:\Users\xx\files\xxxx-storage-xxx or the name of the .json file eg: xxxxx.json ?

  2. Also in general options Upload Folder
    Question: must we specify the google drive as in https://storage.cloud.google.com/xxxxx/ or must this just be /uploads ?

  3. And then in edit tag.
    Question: is this correct upload folder "/myfiles"

Thanks, appreciate any help


MichaelG
User
Posts: 1160

Post by MichaelG »

  1. The "Google Storage credential file (.json)" setting should specify the location of the file
  2. You can specify the google storage as a global upload folder or field specific upload folder. Please read Notes in Upload folder.

crash
User
Posts: 169

Post by crash »

Cannot get this right.. is this supposed to work when testing on local pc
I'm using latest version of ASPNM


MichaelG
User
Posts: 1160

Post by MichaelG »

Yes, it can work on local machine. Show your settings.


crash
User
Posts: 169

Post by crash »

In General setting upload folder I have <https://storage.cloud.google.com/xxxxx/ >

When using the exact same code as in the ASNM help files <google.storage://my-bucket/> it just say failed to load. Copied direct from help file for testing.

I've tried using just my bucket name and also the subfolders, so I've gone back to <https://storage.cloud.google.com/xxxxx/ >

In the edit tag for Upload folder I have "foldername" I have tried this with empty, with / prefix and sufix.

In advanced settings I have the path to my json file on my PC

The files load fine on my server and I can see the image, but nothing load to the GDrive bucket. The drive bucket permissions are set to public and I can load files manually.
It does not load to my root bucket or the subfolders.

Thanks


MichaelG
User
Posts: 1160

Post by MichaelG »

As explained:

The "Google Storage credential file (.json)" setting should specify the location of the file
You can specify the google storage as a global upload folder or field specific upload folder. Please read Notes in Upload folder.

From the help file, the path should be "google.storage://my-bucket/":

The path supports AWS S3, Azure Blob Storage and Google Cloud Storage, but you must specify your upload path in the following format: aws.s3://my-bucket/, azure.blob://my-container/, or google.storage://my-bucket/.


crash
User
Posts: 169

Post by crash »

Both those instruction have been followed...
As indicated when you use google.storage://my-bucket/ it give pop up failed to create

It seems this must have Https in front... but that's not what the help file says

Thanks


MichaelG
User
Posts: 1160

Post by MichaelG »

Show your detail settings.

If you are a registered user, you may want to send your project to the support email for quicker resolution.


crash
User
Posts: 169

Post by crash »

Have done, support says will fix on next release


crash
User
Posts: 169

Post by crash »

When using the option to use the field file upload, I get this error.

An unhandled exception occurred while processing the request.
FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
System.Convert.FromBase64CharPtr(Char* inputPtr, int inputLength)

Thanks


MichaelG
User
Posts: 1160

Post by MichaelG »

Please make sure that you are using the latest version (ASP.NET Maker 24.8.0) and have updated to the latest template (Tools -> Update Template).

The generated appsettings.json should be base64 encoded:

    "google.storage": {
        "ConnectionString": "google.storage://cred=ewog...;bucket={0};",
        "Url": "https://storage.googleapis.com/{1}/{2}"
    },

Post Reply