Using Google Drive Connector to Load Files into Databse

Using Google Drive Connector to Load Files into Databse

  

Hello!

Is it possible to use the Google Drive connector to load files from Google Drive to your Environment's Database? How do I get a binary data type from the URLs being returned by the connector?

Thank you!

Solution

Hi Michael,

I would guess that the URL to the file is on this atribute "DownloadUrl". Than you need to use GetRequest_submit from HTTPRequestHandler to download the file from that URL.

Hope this helps.

Regards,

Marcelo



Solution

Hi!

Thanks for the response. I'm not sure how to do that but I did solve my problem by creating an extension in C# and doing:

byte[] Output = new byte[] { };

using (WebClient client = new WebClient())
            {
                Output = client.DownloadData(URL);
            }

return Output;

I'm not sure though if this is the best practice. I would love some comment on this.

Thanks!

Hi,

That is also a possible solution. But with my solution you don't need to create a new extension. You can use one that already exists.

Regards,

Marcelo

I just found out how to do your suggestion. I didn't realize immediately that it was in the dependencies.

Yep, it's much easier. Thanks again!