3237 |
kaklik |
1 |
:: Batchfile to upload a screenshot to a website via FTP. |
|
|
2 |
:: Called from some 'Spectrum Lab Grabber' applications. |
|
|
3 |
:: FTP screenshots |
|
|
4 |
:: Uses the command line driven FTP client in MS windows. |
|
|
5 |
:: Only works when located in c:\Spectrum\media\sd\capture\ftp_upxxx.bat . |
|
|
6 |
:: Doesn't require any 3rd-party software ! |
|
|
7 |
:: You will need to modify your provider's ftp host name, |
|
|
8 |
:: your user name, and (unfortunately non-encrypted) |
|
|
9 |
:: the FTP password in the 'ftpcmd' lines further below . |
|
|
10 |
:: The name of the file to be sent is specified as argument %1 |
|
|
11 |
:: when this batchfile is invoked (from SL's periodic actions, etc) |
|
|
12 |
:: |
|
|
13 |
:: Make sure we are where we should be (current directory) : |
|
|
14 |
cd c:\Spectrum\ |
|
|
15 |
:: |
|
|
16 |
:: Create the input (command file) for the ftp client program . |
|
|
17 |
:: The line after the USER command is the password . |
|
|
18 |
> ftpcmd.txt ECHO USER robozor_data |
|
|
19 |
>> ftpcmd.txt ECHO robozor_data |
|
|
20 |
>> ftpcmd.txt ECHO cd robozor_data |
|
|
21 |
>> ftpcmd.txt ECHO binary |
|
|
22 |
>> ftpcmd.txt ECHO put %1 |
|
|
23 |
>> ftpcmd.txt ECHO disconnect |
|
|
24 |
>> ftpcmd.txt ECHO bye |
|
|
25 |
:: |
|
|
26 |
:: At this point, we have created a temporary command file |
|
|
27 |
:: for the FTP client. This comman file replaces the input |
|
|
28 |
:: which would be entered via keyboard in an INTERACTIVE ftp session . |
|
|
29 |
:: Now start the ftp client program, output redirected to a file |
|
|
30 |
:: which is EXTREMELY helpful for troubleshooting . |
|
|
31 |
:: Replace the dummy address with your provider's ftp address: |
|
|
32 |
FTP -n -s:ftpcmd.txt home.robozor.cz > ftplog.txt |
|
|
33 |
:: The -n option suppresses the auto-login upon initial connection . |
|
|
34 |
:: The -s option specifies a text file with FTP commands . |
|
|
35 |
:: If the FTP client (above) fails, TEST EACH STEP IN INTERACTIVE MODE ! |
|
|
36 |
:: (each step is now in ftpcmd.txt) |
|
|
37 |
:End |
|
|
38 |
|