Image 01
profile-image

larsbjo

Lars Bjí¸rkhaug
test
File_2_FTP - nautilus scripts

Nautilus Scripts 2 comments

Score 58.0%
May 21 2008
Firstly thanks for the script!

I did some small modifications to make this script work on my Ubuntu pc. I had to replace $file with $@ as $file didn't return anything. I've also added "" to the local dir name to allow for SPACEs in the directory name.

Lastly I've changed the feedback so that the URL is copied to the clipboard rather than being shown in a dialog box.
You might need to download xclip (sudo apt-get install xclip) for the script to work.

If problems with the original script, you might try replacing the last part of the scrip with this:

######################## END OF SETTINGS ##############################
# IMPORTANT! #
# Do not edit bellow this line unless you know what are you doing !!! #
# see 'man ftp' for more options. #
#---------------------------------------------------------------------#

local_dir=$PWD
file=`basename $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS`
# For passive mode add 'p' to the 'ftp' flags (e.g. -pnivg).
ftp -pnivg $host $port > $logfile <<END_SCRIPT
quote binary
quote USER $username
quote PASS $userpass
cd $remote_dir
lcd "" + $local_dir + ""
put $@
bye
END_SCRIPT
# echo `zenity --text-info --filename="$logfile" --title="File_2_FTP - LOG"`
# echo `zenity --info --text="The URL is: http://$URL/$remote_dir/$@"`
echo "http://$URL/$remote_dir/$@"|/usr/X11R6/bin/xclip -selection "clipboard"
exit 0
- Jul 13 2009