FTP Upload Script

As seen on the FM Board ( http://flyingmeat.com/board/viewtopic.php?p=946 ) by “dvancamp”:

Most of the time when I take a screen shot it is to share it. I end up going right to the FTP anyway; so I added this little script to cut out the middleman. I have it automatically saving my shots to my server and placing the URL in my clipboard ready for pasting into my BaseCamp messages.

Currently it’s encoding that space between the date and time so it’s ready to paste. If you don’t want the encoding delete | sed ‘s/ /%20/g’

Save it as “Send to FTP.sh” in your Workflow Scripts folder, update it with your server info, and set the permissions “chmod 755”.

Works for me. YMMV

#!/bin/bash

#FlySketchCloseWindow=YES

HOST=‘example.com/httpdocs/folder/’
USER=‘username’
PASS=‘password’
URL=‘http://www.example.com/folder/’;
FILE=`basename ”$*”`

echo ”$URL$FILE” | sed ‘s/ /%20/g’ | pbcopy

curl -T ”$*” ftp://$USER:$PASS@$HOST