File_2_FTP - nautilus scripts

Nautilus Scripts

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
Score 58.0%
Description:

######################## INFORMATION ################################
File_2_FTP v.1.3 nautilus script (c) 2008 | Sasha Khamkov
license - Free to use but not to sell or gain profit by any other
possible way.
Questions and such - - www.sanusart.com
---------------------------------------------------------------------
Dependencies:
[*] - zenity (present by default in most cases) [newline] [*] - Pure-FTPd (present by default in most cases) [newline]---------------------------------------------------------------------
Description:
[*] - This script makes a use of built-in 'Pure-FTPd' to upload [newline] selected file to FTP server. This is most usefull if you
need to share something and resend the URL to the file.
[p.s.] - There are 2 files -
"File_2_FTP" stores the USERNAME & PASSWORD inside - it
is somewhat unsecure.
"File_2_FTP_secure" asks for USERNAME & PASSWORD at the
time of upload - no sesetive data is exposed.
---------------------------------------------------------------------
Usage:
[1] - Edit settings section bellow
[2] - Put this file to '~/.gnome2/nautilus-scripts/' directory
---------------------------------------------------------------------
Access:
[1] - right mouse button on file to upload.
[2] - Go to scripts => File_2_ftp
[3] - (only 'File_2_FTP_secure')You'll be asked to provide
username & password, it was made to avoid storing
sensitive data inside the script.
[4] - Log will show-up upon successful/failed upload to inform
about the session and details.
[5] - Full URL to the uploaded file will pop-up only if $URL
variable in settings was specified correctly.
---------------------------------------------------------------------
I am NOT responsible for any data loss caused by use of this script
---------------------------------------------------------------------
Last changelog:

11 years ago

21/05/2008
----------
[*] - Added secure version of the script - ask for USER & PASS instead of store.[newline][*] - Outputs URL of uploaded file.[newline][*] - Minor improvements.

larsbjo

10 years ago

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

Report

C

Sanusart

10 years ago

Thank you for the fix.

Just wanted to note that spaces in web related file names often cause problems in some browsers + overwriting the clipboards content will not be welcome among all users, as sometimes, uploading takes longer time and the user might do other clipboard related stuff at the moment.

Thanks.

Report

11 years ago

21/05/2008
----------
[*] - Added secure version of the script - ask for USER & PASS instead of store.[newline][*] - Outputs URL of uploaded file.[newline][*] - Minor improvements.

12345678910
1
product-maker posixru May 29 2012 9 excellent
product-maker Base: 4 x 5.0 Ratings
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs ocs-url or ocs-store to install things
Pling
0 Affiliates
Details
license
version
1.3
updated May 21 2008
added May 18 2008
downloads 24h
0
pageviews 24h 2
System Tags addon