1. Reshma Kumaran
  2. Beta Testing
  3. Monday, 10 February 2020 10:03 AM UTC

Hi,

 

 I have to copy files from AWS S3 bucket to local System without using AWS CLI.

 I got the information like it is possible in PB 2019 Cloud Edition (C#).

Can you please guide me on this.

 

Thanks & Regards,

Reshma S

Reshma Kumaran Accepted Answer Pending Moderation
  1. Wednesday, 12 February 2020 05:44 AM UTC
  2. Beta Testing
  3. # 1

Hi Mich,

 

 Thank you so much for your help.

Can I use C# script in PB 2019 Cloud Edition or PB2019 Cloud Edition Snap Develop option.

 

Thanks & Regards,

Reshma S

Comment
  1. Michael Kramer
  2. Wednesday, 12 February 2020 17:53 PM UTC
It should as I understand Amazon's docs. Amazon states SDK support for .NET Core (async only), .NET Framework 4.5 (async + sync), and "portable class library" aka. .NET Standard. Some of the S3 API is sync-only so it probably requires more coding effort on .NET Core than on .NET Framework. Again, both .NET and AWS expand quickly so you may find different (better?) support when you read this answer than I found when I typed this answer.
  1. Helpful
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Monday, 10 February 2020 15:05 PM UTC
  2. Beta Testing
  3. # 2

Hi Reshma,

There is no PB system object providing specific Amazon access so you have to write code doing the actual Amazon access.

So, you need to create C# object with a "DownloadFileFromAmazon" method taking/returning combination of numeric, string, and BLOB values - or any other "interop compatible data type".

For interop in PowerScript to this C# object you have two choices:

  1. Legacy COM Callable Wrapper using OLEObject
  2. Upcoming C# interop using CSharpObject (requires upcoming PB 2019 R2!)

You may find online code examples accessing Amazon from PowerScript from Chilkat. Beware! These code samples require your app uses proprietary component created by Chilkat. That component requires paid license!

Code sample in case you use upcoming C# interop and your C# object has functions like I call them to set all the values required by AWS S3.

// PREREQUISITES:
// Expect: of_DownloadFile returns "length of downloaded file"
// - or -  Returns negative value when error occurs
function Boolean of_DownloadFromAWS(string as_bucketName, string as_awsPath, string as_downloadFilePath)
long ls_status
n_AWS_S3 lnv_download
lnv_download = n_AWS_S3
lnv_download.of_SetIdentity(this.is_accessKey, this.is_secretKey)
lnv_download.of_SetLocation(this.is_regionID, this.is_endpointURL)
ls_status = lnv_download.of_DownloadFile(as_bucketName, as_awsPath, as_downloadFilePath)
return (ls_status >= 0)

 

Comment
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Monday, 10 February 2020 12:19 PM UTC
  2. Beta Testing
  3. # 3

Hi Reshma,

first of all install AWS SDK for .NET

 https://aws.amazon.com/sdk-for-net/

Then use the C# Class Importer in PB (2019 R2 beta) in order to have a NVO automatically created.

This NVO will initialize the necessary C# classes from Amazon.S3.*, fileTransferUtility primarily.

 

Best,

.m

Comment
  1. Reshma Kumaran
  2. Wednesday, 12 February 2020 05:46 AM UTC
Hi Macro,

Thank you so much for your help.



Can I use C# importter NVO in PB 2019 Cloud Edition or PB2019 Cloud Edition Snap Develop option.



Thanks & Regards,

Reshma S
  1. Helpful
  1. Marco Meoni
  2. Wednesday, 12 February 2020 06:20 AM UTC
Hi,

C# loader is available in both pro and cloudpro editions:



https://www.appeon.com/pricing.html



Check prerequisites here:



https://docs.appeon.com/appeon_online_help/pb2019r2/application_techniques/ch20s01.html



Best,

.m
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.