File doesn't get transmitted using upload and dow - WeOnlyDo Discussion board

File doesn't get transmitted using upload and dow (General questions)

by Kamal, Tuesday, January 04, 2005, 13:15 (7262 days ago)

Hi,

I'm trying to use the Upload and Download CS Sample application to test wodSFTP, I inserted everything as required but the File never got transmitted to the FTP Server!

I've set the debug file and the following has been generated which doesn't make much sense to me!!:

--------------------------------------------------------
ReceiveNotification:EXCEPTION An existing connection was forcibly closed by the remote host
DestroySocket
-------------------------------------------------------

Any help or suggestions would be very much appreciated.

Thank you and hope to hear from you soon..

Kamal

Re: File doesn't get transmitted using upload a

by Kamal, Tuesday, January 04, 2005, 13:41 (7262 days ago) @ Kamal

I’ve added a Blocking = true and the following error came up:

AN unhandled exception of type ‘System.exception’ occurred in weonlydo.client.sftp.dll

Additional info: Server returned an error: General failure

Then I put the putFile method call in a try-catch block and the following error came up:

System.Exception: Server returned an error: General failure
at n.aa()
at n.t()
at n.d(String A_0)
at n.d(String A_0, String A_1)
at WeOnlyDo.Client.SFTP.PutFile(String LocalFile, String RemotePath)
at 3.CS_Upload_and_Download.Form1.button5_Click(object sender, EventArgs e) in c:program etc… sample.cs:line 366

which is the line of:
sftp1.PutFile(textBox5.Text, textBox6.Text);

Re: File doesn't get transmitted using upload a

by wodSupport, Tuesday, January 04, 2005, 14:55 (7261 days ago) @ Kamal

Kamal,

can you paste some code you use? Do you use full paths

/home/joe/something

or you use relative paths

joe/something or even ./something

You must *always* use full paths.

Any chance we could duplicate your problem?

BTW error you get means server is unable to upload the file due to invalid RemotePath value.

Re: File doesn't get transmitted using upload a

by Kamal, Tuesday, January 04, 2005, 15:12 (7261 days ago) @ wodSupport

I believe it is to do with the RemotePath property. Kamal is the folder name in the ftp server, i even tried the following

(
- ftp://FTP Server IP Address in numbers/Kamal ;
- @ FTP Server IP Address in numbersKamalkt.txt ;
- sftp://FTP Server IP Address in numbers/Kamal ;
etc...
)

but nothing worked. all return the same error.


This is the code used:

------------------------------------------------

SFTP sftp;

private void TestwodSFTPComponent()
{
sftp = new SFTP();
sftp.Blocking = true;
sftp.Hostname = FTP Server IP Address in numbers ;
sftp.Port = 22;
sftp.Login = username ;
sftp.Password = password ;

sftp.LocalPath = @ C: Test_FTP_File kt.txt ;
sftp.RemotePath = /Kamal ;

try
{
sftp.Connect();
sftp.PutFile(sftp.LocalPath, sftp.RemotePath);
}

catch{MessageBox.Show(sftp.LastError.ToString());}

finally{sftp.Disconnect();}

---------------------------------------------------

Thank you.

Re: File doesn't get transmitted using upload a

by wodSupport, Tuesday, January 04, 2005, 15:39 (7261 days ago) @ Kamal

Your code looks ok to me, so this isn't the problem. Assuming you actually have permissions to upload file to /Kamal directory, this could be potential bug (or something else is involved).

Is there any chance we could connect to the server and see the problem for ourselves? You can send IP/login/pass to techsupport@weonlydo.com

thanks,
Kreso

Re: File doesn't get transmitted using upload a

by Kamal, Tuesday, January 04, 2005, 16:03 (7261 days ago) @ wodSupport

i had a similar issue with FTP adapter in BizTalk and what I did was setting the Firewall mode property to Passive instead of Active.

Is there any property that allows me to specify the Firewall mode or anything similar to that?

Or do I need to set any permissions on the folder in the remote server??!

Re: File doesn't get transmitted using upload a

by wodSupport, Tuesday, January 04, 2005, 16:16 (7261 days ago) @ Kamal

Kamal,

there is no data connection in SFTP protocol, thus there's no Active/Passive settings.

But permissions could be the issue here. Did you manage to upload file on the same place using any other SFTP client?

Re: File doesn't get transmitted using upload a

by Kamal, Tuesday, January 04, 2005, 16:43 (7261 days ago) @ wodSupport

i tried the SFTP adapter provided by IPWorks which didn't work either but that was used inside BizTalk 2004.

note: i'm working on a virtual PC, i don't know if that makes any difference!!

Re: File doesn't get transmitted using upload a

by wodSupport, Tuesday, January 04, 2005, 18:37 (7261 days ago) @ Kamal

Kamal,

so 2 clients don't work? This is most probably permissions issue. Can you download anything from /Kamal dir?

Kreso

Re: File doesn't get transmitted using upload a

by Kamal, Wednesday, January 05, 2005, 10:08 (7261 days ago) @ wodSupport

No I tried GetFile method, it won't do either!

Could you tell me what is the difference between FTP and SFTP in term of permissions as I'm able to send the file using FTP with the same credentials but not when using SFTP.?!

What are the permissions on the folder that is needed? Read/Write or Full control? and the setting should be for the username used in accessing the server, right??

thank you...

Re: File doesn't get transmitted using upload a

by wodSupport, Wednesday, January 05, 2005, 11:05 (7261 days ago) @ Kamal

Kamal,

there should be no differences. If it works with FTP it should with SFTP too.

Any chance you could send me your IP/login/pass so I could try to connect there and see this in debugging mode? I would be able to tell you what happened 'under the hood' and why is error returned? Please send it to techsupport@weonlydo.com

Re: File doesn't get transmitted using upload a

by Kamal, Wednesday, January 05, 2005, 12:18 (7261 days ago) @ wodSupport

I'm afraid I was instructed to not give these details out!

However, if you have a simple SFTP application that all it does is execute PutFile or GetFile methods with error checking process, I can run it and report the errors to you.

Re: File doesn't get transmitted using upload a

by Kamal, Wednesday, January 05, 2005, 14:57 (7260 days ago) @ Kamal

Do I need to install anything or do anything on the remote server in order to enable it to receive files using SFTP transport type ?!!

Re: File doesn't get transmitted using upload a

by wodSupport, Wednesday, January 05, 2005, 15:11 (7260 days ago) @ Kamal

Kamal,

I am not sure. I can help you with the component itself and it's specifics, but I don't know much about its integration into your package, since I don't know how that environment works in general.

Re: File doesn't get transmitted using upload a

by Kamal, Wednesday, January 05, 2005, 15:20 (7260 days ago) @ wodSupport

The question was, do you normally need to set the server or install the SFTP component in the server to allow it to receive Files using SFTP?!

Does it make any difference if the wodSFTP component installed in both machines are different?!

at the start, the Sample application provided with the component didn't work. so I created a new application, very simple one using a single method as follows:

-----------------------------------------------------------
private void TestwodSFTPComponent()
{
SFTP sftp = new SFTP();
sftp.TempAuthorization = --------- ;
sftp.Blocking = true;
sftp.Hostname = Server.IP.Address ;
sftp.Login = user ;
sftp.Password= pass ;

sftp.LocalPath = @ C:Testkt.txt ;
sftp.RemotePath = /Test_SFTP ;

try
{
sftp.Connect();
sftp.PutFile(
sftp.LocalPath,
sftp.RemotePath);
}
catch(Exception e)
{
MessageBox.Show(e.ToString());
}
finally
{
sftp.Disconnect();
}
}

------------------------------------------------------------

Can you spot any problem with the above set of code, Anything to do with the Order, Any initialisation needed?! :o(


Re: File doesn't get transmitted using upload a

by wodSupport, Wednesday, January 05, 2005, 15:23 (7260 days ago) @ Kamal

Kamal,

your code looks nice - exactly as it should be. I am not sure why it doesn't work. Is there any chance I could connect (using your code) to your server and see this for myself?

Re: File doesn't get transmitted using upload a

by Kamal, Wednesday, January 05, 2005, 18:19 (7260 days ago) @ wodSupport

Problem has been resolved. Just thought i'd share it with you.

to solve the problem, you need to configure the SFTP server from its control panel (The Application is called Configuration!)

From the SSH Secure Shell for Windows Server Configuration Control Panel,

Add the directory (Folder) to the list of accessible directories.

(e.g.: kamal=D:Uploadskamal )

+

Add the user to the list of users allowed to login into the SFTP server.

and that's done! [:happy:]

thank you so much for your help and support.


Re: File doesn't get transmitted using upload a

by wodSupport, Wednesday, January 05, 2005, 19:41 (7260 days ago) @ Kamal

Excellent! I'm the happiest when problems goes away by themselves :) I had no idea what to try more, I admit.

Regards.