| Dart Home | PowerTCP FTP for .NET | Custom Development | Reply | PowerTCP FTP for .NET Topics | Forums |
| Author | Forum: PowerTCP FTP for .NET Topic: Error using Put() |
| pcxbrook@voicenet.com pcxbrook@voicenet.com From: Greenville, DE USA Posts: 6 Member Since: 06/20/04 |
posted June 21, 2004 2:05 AM My window service is successfully connecting to the FTP server and changing to the desired directory. However, when I call the Put() method I receive this error (thrown as an exception): Logon Failure: The target account name is incorrect. Code is as follows: oFTP.Server = oMediaServer.HREF; oFTP.Username = oMediaServer.FTPLoginName; oFTP.Password = oMediaServer.FTPPassword; oFTP.FileType = FileType.Image; oFTP.DoEvents = true; oFTP.Passive = true; oFTP.Restart = false; oFTP.StoreType = StoreType.Replace; oFTP.Invoke( FtpCommand.ChangeDir, oMediaServer.FTPDirectory ); CurrentDirectory = oFTP.GetDirectory(); . . . FtpFile oFTPResults = oFTP.Put( FromFileName, ToFileName ); CurrentDirectory equals what I expect it to and I have the required permissions in that directory. FromFileName is a file found on another server located on the network. The ToFileName is just the file name without a path. The file is about 35MB in size. Any thoughts? Cheers, Brook |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted June 21, 2004 8:58 AM Maybe you have to set the account property? I've never had a server require it, but it's there if you need to try it. |
| pcxbrook@voicenet.com pcxbrook@voicenet.com From: Greenville, DE USA Posts: 6 Member Since: 06/20/04 |
posted June 21, 2004 11:43 AM If I try sending a file that is located on the same server as the Window service, the file is sent. The problem appears to be sending a file that is located on another Windows server. I know the file is being found, because if I misspell the file name, I get an error. (I am using mapped drives) The Window service is designed to FTP large files where they need to go. The FTP request by a user is dropped into a queue, which the Window service is monitoring. When it finds a request, it spawns a thread to do the job. I really need the ability for the FromFile (the file the user wants to FTP) to be located on any number of services found on the internal network. As to the Account property, it is not clear to me what value you might assign to it. Please advise. Cheers, Brook |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted June 21, 2004 11:58 AM Disregard what I said about the account property. This now sounds like a case where the Windows Service user does not have permission (or knowledge of) the mapped drive. What happens if you have the service login as a user with Domain rights to both machines? |
| pcxbrook@voicenet.com pcxbrook@voicenet.com From: Greenville, DE USA Posts: 6 Member Since: 06/20/04 |
posted June 21, 2004 12:34 PM When I ran the service out of an account that had rights to all servers, it worked fine. I guess my only suggestion would be that the error message should be a little more speicific, i.e. the word Windows should be in the message. Thanks for your help. Cheers, Brook |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted June 21, 2004 12:41 PM The text of that error message isn't coming from us. I just searched our source code and was not able to find the phrase "target account name" The message is either coming from somewhere in your code or from the ftp server itself. |
| pcxbrook@voicenet.com pcxbrook@voicenet.com From: Greenville, DE USA Posts: 6 Member Since: 06/20/04 |
posted June 21, 2004 1:04 PM Interesting. The message comes from an exception thrown by your code - a call to the Put() method (I am passing just two parameters the From and To filenames. I am catching it with SystemException. Also, why would the FTP server generate the error? The file being sent is on a Window server and it is being read as a file on the internal network. The file is being sent to an FTP outside the internal network. The login to the FTP server has always worked, as evident by the fact that I could always change directories and delete files as desired from my code. As such, maybe one of the the .NET objects you are using inside your code is generating the exception. Cheers, Brook |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted June 21, 2004 1:16 PM You could use the Trace event to make a Trace log that shows the exact conversation between the client and server. That will show you the context of the message. See the Listview sample for an example of how to create a trace log. |
| Reply | PowerTCP FTP for .NET Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|