Button to send file(s) to FTP server
Moderators: Hacker, petermad, Stefan2, white
Button to send file(s) to FTP server
I need to upload a file to an FTP server on weekly basis. Is there a way to script a button to send the highlighted file(s) to an ftp server without the need to step through connecting, navigating to the folder on the server then uploading?
Well, not completely, without using an external scrip tool like AHK.
But you can almost do it without AHK - except you have to press F5 to upload, and confirm:
Let us assume that the file you want to upload is called c:\mydirectory\myfile.txt
and the directory you want to upload to is: myftpserver.com/myftpdirectory
Make a button with these parameters.
Command: cd c:\mydirectory\myfile.txt
Start path: ftp://username:password@myftpserver.com/myftpdirectory
If you omit :password you will be prompted for the password.
The file myfile.txt will be highlighted, but if it is way down in the file list, then you have to scroll a little to see it, because it gets hidden when the FTP-bar in TC is opened. But even though you can't see the file without scrolling, you can still press F5 to have it copied.
But you can almost do it without AHK - except you have to press F5 to upload, and confirm:
Let us assume that the file you want to upload is called c:\mydirectory\myfile.txt
and the directory you want to upload to is: myftpserver.com/myftpdirectory
Make a button with these parameters.
Command: cd c:\mydirectory\myfile.txt
Start path: ftp://username:password@myftpserver.com/myftpdirectory
If you omit :password you will be prompted for the password.
The file myfile.txt will be highlighted, but if it is way down in the file list, then you have to scroll a little to see it, because it gets hidden when the FTP-bar in TC is opened. But even though you can't see the file without scrolling, you can still press F5 to have it copied.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Button to send file(s) to FTP server
That would be possible if the command cm_FtpDownloadList would except a file name as parameter. Alas, but perhaps some day Total Commander batch files will become reality.risk wrote:I need to upload a file to an FTP server on weekly basis. Is there a way to script a button to send the highlighted file(s) to an ftp server without the need to step through connecting, navigating to the folder on the server then uploading?
You can use FTP Download From List (cm_FtpDownloadList) to upload your file to your server. A good way to create an upload list for this is to make a download list first and then to change it into an upload list. To do this connect to your ftp server, locate your file and right click the file. Choose Add to downloadlist to create a download list. Next, open the download list in your editor and add "put:c:\yourfolder\yourfile -> " in front of the line in the download list. Save it and you're done. Make the file read only so it won't be changed and you can use the file more than once.
You could also use the Synchronize Dirs function to upload your file. In one panel browse to your file on you hard disk. In the other panel connect to your server and locate your file. Then select menu option Commands/Synchronize Dirs. Enter the name of your file in the filter field at the top middle (where is says "*.*"). Save the settings by clicking the button at the top left and choosing "Add current directories and setting to list". Suppose you saved your settings under the name "syncmyfile", you can use a button with the command "SYNCOPEN syncmyfile" to quickly sync your file.
Or click the button a second time.petermad wrote:The file myfile.txt will be highlighted, but if it is way down in the file list, then you have to scroll a little..
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC