Hi all,
I am trying to use Core FTP in command line mode to upload files produced by MS SQL Server to a web site. TSQL, the scripting language of MS SQL Server, allows me to execute shell commands. When I try to do this with Core FTP, it hangs forever. I need to kill the Core FTP Process in order to unfreeze the TSQL procedure.
Here the details:
Core FTP Version 1.3, Build 1427. Registered!
Command Line:
C:\PROGRA~1\CoreFTP\coreftp.exe -O -s -site www_mysite_com -u D:\FTP-Server\upload\test_upload.txt -p /http/upload/docs/docs/test -log C:\PROGRA~1\CoreFTP\log.txt
This command line works perfectly if I execute it in a Cmd windows but it hangs forever if I execute it within a TSQL procedure like this:
exec master..xp_cmdshell 'C:\PROGRA~1\CoreFTP\coreftp.exe -O -s -site www_mysite_com -u D:\FTP-Server\upload\test_upload.txt -p /http/upload/docs/docs/test -log C:\PROGRA~1\CoreFTP\log.txt'
I use the -s Option to prevent any output. Furthermore, I registered to avoid the splash screen.
The log file specified in the command line is created but remains empty (0 bytes).
I noticed that in command line mode, Core FTP creates a system tray icon while is runs. It does this also in silent mode. That means that it still somehow creates output and relies on a graphical output device. Could this be the problem? How can I prevent the system tray icon?
I appreciate any suggestions how I can get this application working. Is anymore successfully using Core FTP from within TSQL procedures?
Thanks
Gabe
Command line mode hangs
CP,
The call is a blocking call i.e. the TSQL procedure hangs until that command line task is completed.
The default working directory of the TSQL procedure is C:\WINNT\system32\ on our machine.
My guess is that a truly silent mode would solve the problem. We use the command line mode successfully with many other programs. For example, we use the Lynx web browser in command line mode to access web services from within TSQL procedures.
Gabriel
The call is a blocking call i.e. the TSQL procedure hangs until that command line task is completed.
The default working directory of the TSQL procedure is C:\WINNT\system32\ on our machine.
My guess is that a truly silent mode would solve the problem. We use the command line mode successfully with many other programs. For example, we use the Lynx web browser in command line mode to access web services from within TSQL procedures.
Gabriel
Hi, thanks for the quick reaction. I tried the new build with the -noicon option but unfortunately the problem remains.
This is the current command line I use from within TSQL procedures:
C:\PROGRA~1\CoreFTP\coreftp.exe -noicon -O -s -site www_msite_com -u D:\FTP-Server\upload_mysite_web\test_upload.txt -p /http/upload/docs/docs/test -log C:\PROGRA~1\CoreFTP\log.txt
A few more observations: When I execute a TSQL procedure that contains an FTP upload, two new processes are created: cmd.exe and coreftp.exe. The procedure then hangs forever. If I kill the coreftp.exe process from within the windows task manager, the TSQL procedure continues processing. The specified log.txt file is created but remains empty.
Any more ideas?
Gabe
This is the current command line I use from within TSQL procedures:
C:\PROGRA~1\CoreFTP\coreftp.exe -noicon -O -s -site www_msite_com -u D:\FTP-Server\upload_mysite_web\test_upload.txt -p /http/upload/docs/docs/test -log C:\PROGRA~1\CoreFTP\log.txt
A few more observations: When I execute a TSQL procedure that contains an FTP upload, two new processes are created: cmd.exe and coreftp.exe. The procedure then hangs forever. If I kill the coreftp.exe process from within the windows task manager, the TSQL procedure continues processing. The specified log.txt file is created but remains empty.
Any more ideas?
Gabe
Why cmd.exe is created? I am not an expert but I guess a shell is needed to execute a command line tool. Anyway, the TSQL procedure xp_cmdshell works this way. I am not aware of any other ways to execute external tool from within TSQL.
I have tried the -hide option. This doesn't seem to make a difference.
I noticed one thing that is different with CoreFtp from any of the other command line tools we use. If I use CoreFtp on the command line, it returns immediately after submitting the command. The real work seems to be done somehow in a background process that may run long after the command line returned. Could this somehow contribute to the problem we see?
Gabe
I have tried the -hide option. This doesn't seem to make a difference.
I noticed one thing that is different with CoreFtp from any of the other command line tools we use. If I use CoreFtp on the command line, it returns immediately after submitting the command. The real work seems to be done somehow in a background process that may run long after the command line returned. Could this somehow contribute to the problem we see?
Gabe
Hi Chris,
I have tried the new corecmd.exe utility. It works as expected in command line mode but still does not work from within TSQL procedures. We see the same problem as before. The procedure hangs forever. I need to kill the coreftp process to de-block the TSQL procedure.
In the mean time I also experimented with other command line ftp tools. I have found WCL FTP that does work from within TSQL procedures. It has the disadvantages that it behave not very nicely when there are errors, for example a file specified for upload cannot be found. For that reason I have not given up yet on CoreFTP. Do you still see a chance to get it working?
Thanks for your great support so far.
Gabriel
I have tried the new corecmd.exe utility. It works as expected in command line mode but still does not work from within TSQL procedures. We see the same problem as before. The procedure hangs forever. I need to kill the coreftp process to de-block the TSQL procedure.
In the mean time I also experimented with other command line ftp tools. I have found WCL FTP that does work from within TSQL procedures. It has the disadvantages that it behave not very nicely when there are errors, for example a file specified for upload cannot be found. For that reason I have not given up yet on CoreFTP. Do you still see a chance to get it working?
Thanks for your great support so far.
Gabriel