Jump to content

[Question] Send to > Ftp server? How to?


Mikep7779

Recommended Posts


I'm sure it's not as beautiful as if it were hidden, but this simple script does what you want. It uploads a file:

Write the following code into a *.CMD or *.BAT and put it into your SendTo-Folder.

Note: You have to enter your password, server and your username ;)

@echo off
echo.##################
echo.# #
echo.# Uploading File #
echo.# #
echo.##################

set user=YOUR_USERNAME_GOES_HERE
set pass=YOUR_PASS_GOES_HERE
set srvr=YOUR_SERVER_GOES_HERE

echo.open %srvr%>%temp%\sendtoftp.log
echo.%user%>>%temp%\sendtoftp.log
echo.%pass%>>%temp%\sendtoftp.log
echo.BINARY>>%temp%\sendtoftp.log
echo.put %1>>%temp%\sendtoftp.log
echo.bye>>%temp%\sendtoftp.log
ftp -s:%temp%\sendtoftp.log
del %temp%\sendtoftp.log

Hope it helps :P

/PITU

Link to comment
Share on other sites

You don't seem to understand the script...

What it does is to echo your settings to a logfile. after that it starts the ftp.exe with the logfile _as source_.

After it's done the script deletes the logfile.

You can upload any file with that script

EDIT: Just give it a try and you'll see: it works fine

Edited by PITU
Link to comment
Share on other sites

Do you mean the remote dir? Yes, that's possible:

@echo off
echo.##################
echo.# #
echo.# Uploading File #
echo.# #
echo.##################

set user=YOUR_USERNAME_GOES_HERE
set pass=YOUR_PASS_GOES_HERE
set srvr=YOUR_SERVER_GOES_HERE
set rdir=/YOUR_REMOTE_DIR_GOES_HERE

echo.open %srvr%>%temp%\sendtoftp.log
echo.%user%>>%temp%\sendtoftp.log
echo.%pass%>>%temp%\sendtoftp.log
echo.BINARY>>%temp%\sendtoftp.log
echo.cd %rdir%>>%temp%\sendtoftp.log
echo.put %1>>%temp%\sendtoftp.log
echo.bye>>%temp%\sendtoftp.log
ftp -s:%temp%\sendtoftp.log
del %temp%\sendtoftp.log

Note:

set rdir=/YOUR_REMOTE_DIR_GOES_HERE

starting with "/"

for example:

set rdir=/new folder

if you have a folder called "new folder" in your root directory of the remote machine :P

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...