S3 Session.Open failing on Session.HomePath

Advertisement

Cstro2022
Guest

S3 Session.Open failing on Session.HomePath

I am trying to get generated code to work in a VB Script, but it fails within the WinSCP DLL at Session.HomePath with this error
"Session.HomePath' threw an exception of type 'System.InvalidOperationException' String {System.InvalidOperationException}"
Any ideas ?

Below is the script with my access and secret removed, it is trying to access a public S3 site, so anyone can put in their Access Key and Secret and you should be able to access the site.
' Set up session options
Dim sessionOptions As New SessionOptions
With sessionOptions
    .Protocol = Protocol.S3
    .HostName = "s3.amazonaws.com"
    .UserName = "xxxxxxxxx"     'Access Key
    .Password = "xxxxxxxxxxxx"       'Secret
End With
 
sessionOptions.AddRawSettings("S3DefaultRegion", "us-east-1")
sessionOptions.AddRawSettings("S3UrlStyle", "1")
 
Using session As New Session
    ' Connect
    session.Open(sessionOptions)   'fails here
 
    ' Transfer files
    session.GetFiles("/gov-fpac-rma-pubfs-production/pub/References/actuarial_data_master/2023/2023_ADM_Daily_220815.zip", "C:\temp\*").Check()
End Using

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: S3 Session.Open failing on Session.HomePath

Your code is not accessing Session.HomePath at all. It cannot be throwing that exception. Double check what code did actually threw that error.

Reply with quote

Advertisement

You can post new topics in this forum