S3 amazon

Advertisement

dimalexan
Guest

S3 amazon

Hi. Is it possible to work with the S3 amazon cloud through a com object? If so, what Session options settings need to be set to connect to the cloud?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
33,846
Location:
Prague, Czechia

Re: S3 amazon

Yes.

Set SessionOptions.Protocol to Protocol.S3.

The easiest is to have the GUI generate the code for you.
https://winscp.net/eng/docs/ui_generateurl#code

While it cannot generate "COM" code, you can have it generate for example C# code. It should be easy then to translate that to COM and your programming language.

Reply with quote

dimalexan
Guest

Ошибка при вызове метода контекста (Open): Произошла исключительная ситуация (WinSCPnet): Значение не может быть неопределенным.
Имя параметра: sessionOptions

//Задаем параметры подключения
//Protocol = Новый COMОбъект("WinSCP.Protocol");
sessionOptions = Новый COMОбъект("WinSCP.SessionOptions"); //Создаем объект SessionOptions
sessionOptions.Protocol = 4;//"Protocol.S3";
//sessionOptions.PortNumber = 443;
sessionOptions.HostName = "storage.yandexcloud.net";
sessionOptions.UserName = "access_key";
sessionOptions.Password = "secret_key";
sessionOptions.RootPath = "Bucket name";

session = Новый COMОбъект("WinSCP.Session"); //Создаем объект Session

//Подключаемся
session.Open(sessionOptions);
session.PutFiles(ИмяФайлаПолное, "/sbermarket-retailers-begemag/*").Check();
session.Dispose();

Reply with quote

Advertisement

You can post new topics in this forum