URL := 'ftp://remote_server/remote_folder/testfile.txt'; FTPRequest := WebRequest.Create(URL); Credentials := Credentials.NetworkCredential('some_login', 'some_password'); FTPRequest.Credentials := Credentials; FTPRequest.KeepAlive := false; FTPRequest.UseBinary := true; FTPRequest.Method := 'STOR'; FTPRequest.UsePassive := true; FileStream := FileA.OpenRead('c:\testfile.txt'); FTPRequest.GetRequestStream.Write(FileA.ReadAllBytes('c:\testfile.txt'), 0, FileStream.Length); --- WebRequest DotNet 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.WebRequest FTPRequest DotNet 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.FtpWebRequest Credentials DotNet 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.NetworkCredential FileStream DotNet 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.FileStream FileA DotNet 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.File URL Text 250
Comments
http://dynamicsuser.net/blogs/waldo/archive/2011/04/19/nav-2009-r2-net-interop-using-enumerations-part-1.aspx
http://dynamicsuser.net/blogs/waldo/archive/2011/05/30/net-interop-using-the-parent-to-get-to-the-child-using-enumerations-part-2.aspx
I wonder if you ever got this working with downloading by ftp?
Thanks to your sharing I was able to get the upload working, but I can't figure out the syntax to make it download.
My attempts shown here:
viewtopic.php?f=32&t=58060
Would really appreciate any advice. This is absolutely a first attempt with anything dotnet for me.
Bruce Anderson
Enjoy.
Best Regards
Mads Morre