FTP from within Textpad

Instructional HowTos, posted by users. No questions here please.

Moderators: AmigoJack, helios, bbadmin, Bob Hansen, MudGuard

Post Reply
[XAP]Bob
Posts: 4
Joined: Wed May 25, 2005 2:53 pm

FTP from within Textpad

Post by [XAP]Bob »

It seems that Textpad has a little hole which isn't going to be patched. While looking for a simple solution to what seems like a pretty simple problem I decided to DImYself...

First up, preperation. I have a diretory on my HDD called scripts - it just keeps things nice and tidy, I know my scripts can create/delete all sorts of non .bat files safely...

So I first made this script - to be saved as c:\scripts\ftpme.bat

Code: Select all

echo off

rem Script to upload using the Windows FTP client.

rem Takes a single paramter (filename) and uploads it
rem to the hardcoded FTP site.

set site=
set dest=
set user=
set pass=

echo "Uploading %1"

echo open %site% > ftpscript.scr
echo user >> ftpscript.scr
echo %user% >> ftpscript.scr
echo %pass% >> ftpscript.scr
echo cd %dest% >> ftpscript.scr
echo put %1 >> ftpscript.scr
echo quit >> ftpscript.scr

ftp -n -s:ftpscript.scr

del ftpscript.scr

pause
Obviously you'll need to fill in the values for site, dest, user and password.
The site is the login site, dest is the directory, user and pass are exactly that.

Now I need it to run from in TextPad to upload the file currently on show, so I make it a TextPad "tool":
  • + Menu - Configure->Preferences and select tools (bottom left)
    + Add (top right) a PROGAM and browse to the newly created batch file (c:\scripts\ftpme.bat)
    + Click APPLY
    + Expand the tools tree and select FTPme
    + The command will look like "C:\Scripts\ftpme.bat"
    + Add the parameter: "$DOSFile"
    + I have "Save all docs first" selected and an audio warning...
    + Click OK

We can now upload the current file by going to the Menu Tools->ftpme - or Ctrl-x (where x is the tool number)

To add an icon to textpad simply RHC on the menu, customise and drag the relevant icon from the tools array. It looks pants but it works...


HTH someone...

Bob


LIMITATIONS:
Fixed destination - you could have several batch files if you wanted a couple of destinations.
Active file only...
Security*
Icon looks pants.

* Let's face it FTP isn't secure anyway, and this is on your local machine - do you really care that this is in plaintext?
Post Reply