How to set "Remote directory" when using C# / .dll for Amazon S3 connection?

Advertisement

MarisB
Joined:
Posts:
9

How to set "Remote directory" when using C# / .dll for Amazon S3 connection?

Your help page: https://winscp.net/eng/docs/guide_amazon_s3
says that
You will not see buckets that were shared with you by another AWS user, in the root listing. To access such buckets, you have to specify /bucketname as an initial Remote directory, when setting up your S3 session. Similarly, when your access key does not have permissions to list buckets, you will need to specify the path to the desired bucket the same way. In scripting, you do that by appending the path to the bucket to a session URL: s3://accesskey:secretkey@s3.amazonaws.com/bucket/.

How to specify bucket in C#? I tried to feed it via SessionOptions.HostName (s3.region.amazonaws.com/bucket/), but it gives me an error: "Authentication failed. The request signature we calculated does not match the signature you provided. Check your key and signing method....."

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
31,464
Location:
Prague, Czechia

Re: How to set "Remote directory" when using C# / .dll for Amazon S3 connection?

Try using
session.AddRawSettings("RemoteDirectory", "/bucket");

Reply with quote

Advertisement

You can post new topics in this forum