Topic "Put Files not working in Amazon AWS server."

Author Message
ramakrishna
[View user's profile]

Joined: 2017-07-26
Posts: 7
Location: india
Hi, Team,

Getting session log out and put files not working in Amazon AWS server. But, its working fine in Local.
I am using 5.9.6 version.

Below is my code

SessionOptions sessionOptions = new SessionOptions
{
Protocol = WinSCP.Protocol.Sftp,
HostName = "sftp.XXXXXX.com",
PortNumber = 22,
UserName = "XXXXXXXXX",
Password = "XXXXXXXXXX",
SshHostKeyFingerprint = "XXX-XXa 1098 xx:xx:xx:xx:xxx:xxx:xx:xx:xx:",
};

using (Session session = new Session())
{
// Connect
session.Open(sessionOptions);

// Your code
}
session.DebugLogPath = Server.MapPath("Temp/") + "logWinSCP";
session.Open(sessionOptions);

// Upload files
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;

TransferOperationResult transferResult = null;
transferResult = session.PutFiles(Server.MapPath("Temp/" + _fileName), "/users/adminTest/sample/", false, transferOptions);

// Throw on any error
transferResult.Check();


Thanks,
Ram
Advertisements
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
Sorry, your post does not include enough information.

Please read how to troubleshoot problems with WinSCP. If it turns out that you are not able to help yourself, read how to ask for support or report bugs efficiently, so others can help you.
ramakrishna
[View user's profile]

Joined: 2017-07-26
Posts: 7
Location: india
Thanks for the response Martin,

In a server when I'm trying to connect FTP box with WINScp client, I'm able to connect and get and put files. But on the same server when I'm trying to put files using WINSCP .net assembly, I'm getting connection timed out the issue.

I thought like it may be the firewall which blocks but in that scenario, I should not connect to FTP box with WINSCP client also.

Could you please let me know what could be the problem?

for your reference.
Below is my code

SessionOptions sessionOptions = new SessionOptions
{
Protocol = WinSCP.Protocol.Sftp,
HostName = "sftp.XXXXXX.com",
PortNumber = 22,
UserName = "XXXXXXXXX",
Password = "XXXXXXXXXX",
SshHostKeyFingerprint = "XXX-XXa 1098 xx:xx:xx:xx:xxx:xxx:xx:xx:xx:",
};

using (Session session = new Session())
{
// Connect
session.Open(sessionOptions);

// Your code
}
session.DebugLogPath = Server.MapPath("Temp/") + "logWinSCP";
session.Open(sessionOptions);

// Upload files
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;

TransferOperationResult transferResult = null;
transferResult = session.PutFiles(Server.MapPath("Temp/" + _fileName), "/users/adminTest/sample/", false, transferOptions);

// Throw on any error
transferResult.Check();

Thanks,
Rahul.
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
We need log files! Both from GUI and the code.
And note that FTP is not SFTP. You are confusing those two.
ramakrishna
[View user's profile]

Joined: 2017-07-26
Posts: 7
Location: india
Hi,

Please find the attached log file of GUI, from code, the log file is not generating (it's saying session timeout).
I am using SFTP not FTP its typing issue.


Thanks,
Rahul.
sftp.XXXXXX.com.log (20 KB) Private file

Description: GUI Log file.

ramakrishna
[View user's profile]

Joined: 2017-07-26
Posts: 7
Location: india
Hi,

Please find the attached code log file and GUI log file.

Thanks,
Rahul.
GUI Log.log (20 KB) [Download]

Description: GUI log file

CodeLogfile.txt (6.82 KB) [Download]

Description: Code log file

ramakrishna
[View user's profile]

Joined: 2017-07-26
Posts: 7
Location: india
martin wrote:
We need log files! Both from GUI and the code.
And note that FTP is not SFTP. You are confusing those two.


Hi Martin, Waiting for your replay.

Thanks,
Ram.
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
You are getting this error:
https://winscp.net/eng/docs/message_library_timeout_waiting_to_respond
ramakrishna
[View user's profile]

Joined: 2017-07-26
Posts: 7
Location: india


Hi, Thanks for your reply.

I tried with

session.ExecutableProcessUserName = "XXXX";
session.ExecutableProcessPassword="XXXXXX";

Error message changed and now I am getting
"System.ComponentModel.Win32Exception (0x80004005): Access is denied" error.

and I changed IIS impersonation permissions levels also still I am facing the same issue.

Thanks,
Rahul.
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
Without an exception callstack, it's difficult to tell what causes the problem.
Where do you have winscp.exe stored? Does the local account have permissions to that file?
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License