Created
August 26, 2014 12:10
-
-
Save thykka/05a1f615e30f044d50cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: [ v Config starts v ] | |
set FTP_hostname=12.34.56.78 | |
:: Your FTP username (cannot be blank) | |
set FTP_username=1337h4x0r | |
:: Your FTP password (cannot be blank) | |
set FTP_password=rosebud | |
:: Remote folder to upload to (optional) | |
set FTP_remote_dir=screenshots | |
:: [ ^ Config ends ^ ] | |
:: Generate FTP command list ] | |
echo user %FTP_username%> ftpcmd.dat | |
echo %FTP_password%>> ftpcmd.dat | |
if defined FTP_remote_dir ( | |
echo cd %FTP_remote_dir%>> ftpcmd.dat | |
) | |
echo put %1>> ftpcmd.dat | |
echo quit>> ftpcmd.dat | |
:: Run FTP with command list | |
ftp -n -s:ftpcmd.dat %FTP_hostname% | |
del %1 | |
:: Clean up command list and env vars for minimal security | |
del ftpcmd.dat | |
set FTP_username= | |
set FTP_password= | |
set FTP_remote_dir= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment