Welcome Guest.   Make a donation to an author on the site September 30, 2014, 06:49:49 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Check out and download the GOE 2007 Freeware Challenge productivity tools.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: FTP Uploader Script  (Read 12513 times)
damax
Charter Member
***
Posts: 23


View Profile Give some DonationCredits to this forum member
« on: February 17, 2008, 08:56:46 AM »

Description:
------------
I wrote a small VBS script which will upload a file to an FTP server and put a
link to it in your windows clipboard. The script is written to be used with
Screenshot Captor but can also be used externally.

You can get it here:
Upload_to_FTP.zip
It is my first contribution to DonationCoder, so please be kind with your criticisms.

I hacked this together because I always missed this functionality in Screenshot
Captor. In this forum there were some discussions going on on how to get this
functionality into SC. The most common solution was to use either FtpUpload.exe
or RCFtp. FtpUpload.exe provided the clipboard functionality but was not able to
upload the file anywhere other than the root directory and RCFtp didn't provide
the clipboard functionality.

So here we have both: possibility of uploading the file to any directory on the
FTP server and a handy link to that file in your windows clipboard afterwards.

Requirements:
-------------
Windows 98/ME/XP/2000/Vista(?)
 with installed Scripting Host
Internet Explorer (for clipboard functionality)

The script was only tested on Windows XP Professional yet.
If you want to try it on another version, please inform me about the results.

Usage with Screenshot Captor:
-----------------------------
1. Copy the script into your Screenshot Captor directory

2. Create a new external tool link in Screenshot Captor:
   2.1. Menu "Tools" -> "Configure external tools" -> "add"
   2.2. Think of a nice title (eg. "Upload to FTP")
   2.3. Insert screenshot_to_ftp.vbs as Program
   2.4. Leave working dir blank (the script uses your windows home directory
        to create a small temp file which is deleted right after execution)
       
   2.5. The parameters for the script are:
   
       ftpserver username password externalpath filename [url]
       
       - FTP-Server: the server where you want to put your screenshot
       - User name: the user name to use for the ftp server
       - Password: the password to use for the ftp server
         (use "" for empty password)
       - External path: the directory on the server to put the file into
         Use a simple slash (/) if you want to upload to the root directory
       - File name: use "%file%" including quotes
       - URL (optional): the URL which is copied to your clipboard.
         Leave URL empty if you don't want to use the clipboard functionality
     
       Example:
       ftp.foobar.org foo bar /foo/bar/ "%file%" http://www.foobar.org/foo/bar/
       
       This will connect to ftp.foobar.org with "foo" as username and "bar" as
       password. It will then change to the directory /foo/bar/ on the server and
       put the selected file there via FTP. The given URL is then completed with
       the filename and will be written to the windows clipboard.
       
       PLEASE NOTE that both external path and URL have to end with a slash (/).
       If you want to put the file to the root directory of the server, use "/"
       (without quotes) as external path.

       Here is how it looks like when you're done:

       
3. You can now select a file in Screenshot Captor and use Tools -> Upload to FTP
   to upload the file. The URL to the file will be ready for use in your windows
   clipboard afterwards.


Usage without screenshot captor:
--------------------------------
If you're into batch programming, you may also use this script from a DOS batch
file. Just call it by

cscript [Drive:\][Path to file]\screenshot_to_ftp.vbs ftpserver username password externalpath filename url

and it will behave just as described above.

Known limitations:
------------------
- Empty password is not possible (any idea on how to realize a variant number of
  parameters)?

 

Found bugs? Added some functionality?
-------------------------------------
Feel free to contact me. I will try to answer every post but please give me some time. I got a life to live, y'know Wink

« Last Edit: February 19, 2008, 12:05:48 AM by damax » Logged

====___====
|>/\|||/\><
===========
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: February 17, 2008, 09:04:43 AM »

Great work!! smiley

And i'm glad there's a superior alternative to ftpupload Wink

About the empty password.. How about if you used "" to mean empty password?
Logged

damax
Charter Member
***
Posts: 23


View Profile Give some DonationCredits to this forum member
« Reply #2 on: February 17, 2008, 11:38:04 AM »

You are right! Double quotes for empty password works perfectly  Thmbsup Thanx for that!
Logged

====___====
|>/\|||/\><
===========
lanux128
Global Moderator
*****
Posts: 6,100



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: August 29, 2008, 12:36:41 AM »

what a cool script! i couldn't believe i hadn't noticed this before. good job, damax! Thmbsup

btw, i used vbstoexe to convert the script into an exe. hope you don't mind.
Logged

damax
Charter Member
***
Posts: 23


View Profile Give some DonationCredits to this forum member
« Reply #4 on: August 29, 2008, 01:16:12 AM »

Thank you for the flowers, lanux128. Converting the script to an exe is indeed a very nice idea. Didn't know of vbstoexe yet. I think I will do this on the weekend <- does not work, see below.
« Last Edit: September 02, 2008, 01:47:14 AM by damax » Logged

====___====
|>/\|||/\><
===========
lanux128
Global Moderator
*****
Posts: 6,100



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: August 29, 2008, 01:23:55 AM »

nice to hear from you damax. smiley just wondering if your script is capable of overwriting existing files on the ftp server? this could be useful when uploading updated screenshots.
Logged

damax
Charter Member
***
Posts: 23


View Profile Give some DonationCredits to this forum member
« Reply #6 on: August 29, 2008, 02:01:15 AM »

...ermmm.... hm.... never experienced that case before because all my screenshots get timestamped.
The script uses the FTP-command put to upload the file. This here says that put will react with a "Permission denied"-error if the file already exists on the remote server Sad I believe it'd be possible to delete the remote file first in that case but I can't be bothered at the moment  Wink Feel free to enhance the script if you like.
« Last Edit: August 29, 2008, 02:08:23 AM by damax » Logged

====___====
|>/\|||/\><
===========
lanux128
Global Moderator
*****
Posts: 6,100



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: August 29, 2008, 02:32:26 AM »

my screenshots are timestamped too but i sometimes modify them and save with the same filename but it's okay since the 'put' doesn't seem to allow over-writing. your script still gets the job done, though. smiley
Logged

damax
Charter Member
***
Posts: 23


View Profile Give some DonationCredits to this forum member
« Reply #8 on: September 01, 2008, 11:58:25 AM »

VbsToExe worked for you? The generated .exe doesn't do a thing here on my computer huh I used the command "VbsToExe.exe screenshot_to_ftp.vbs screenshot_to_ftp.exe" but when I double-click the *.exe, nothing happens. The same is true if I try to use the *.exe in SC. Just nothing......
Logged

====___====
|>/\|||/\><
===========
lanux128
Global Moderator
*****
Posts: 6,100



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: September 01, 2008, 07:50:52 PM »

now that you mentioned i went and checked. the converted exe doesn't work actually (!) i had been using the script all this while without realizing it. ohmy

even the website makes a note of it:

Quote from: website
NOTICE

The resulted program may not work correct. Some VBScript functions are not available.
You may test it for functionality.
Logged

cvbusa
Charter Member
***
Posts: 32


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #10 on: September 14, 2008, 10:23:11 PM »

Hi ... nice script programming.

Rightload (mentioned on this forum previously) is what I use. It allows uploading to ftp servers ( to a fixed or custom directory ) by right clicking on any image thumbnail listed in the SC file directory left-hand panel and copies the URL link to the clipboard.

Later ... Charles

Rightload Home - http://rightload.org/

Snapshot - http://screencast.com/t/napMvRprx
Logged
lanux128
Global Moderator
*****
Posts: 6,100



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #11 on: September 14, 2008, 10:34:51 PM »

yes, Rightload is quite an able tool but i wonder if this feature has been implemented, copy uploaded path to clipboard? this is essential for me, hence the usage of damax's script. smiley
Logged

cvbusa
Charter Member
***
Posts: 32


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #12 on: September 15, 2008, 12:18:27 AM »

Yes ... Rightload does copy the upload path ( URL ) to the clipboard after the upload is complete. The other nice feature is that Rightload can be configured for multiple FTP sites. Just right click a thumbnail in the SC browser panel, select one of the destination FTP sites that you have configured and you are good to go!!!

Charles
Logged
damax
Charter Member
***
Posts: 23


View Profile Give some DonationCredits to this forum member
« Reply #13 on: September 15, 2008, 01:11:50 AM »

G'damn it. I hoped I had written something that was not implemented before Sad well well, you can't have it all, right?
Logged

====___====
|>/\|||/\><
===========
cvbusa
Charter Member
***
Posts: 32


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #14 on: September 15, 2008, 01:22:05 AM »

A nice piece of programming is never a waste of time if you enjoyed the experience and learned something ... Charles.
Logged
lanux128
Global Moderator
*****
Posts: 6,100



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: September 15, 2008, 01:27:58 AM »

exactly both damax's script and rightload has proved to be very useful. Thmbsup
Logged

cvbusa
Charter Member
***
Posts: 32


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #16 on: September 15, 2008, 12:46:30 PM »

I should mention that Rightload can upload multiple files at once to an FTP site and provides the user graceful options for handling duplicate files.

1) Control click multiple thumbnails from the Screenshot Captor ( SC ) image/file browser panel
2) Right click the selection
3) Use the "Upload with Rightload" option to select the FTP destination site ( or queue )

Screencast (no audio )of multi-file selection in SC and sending
the selection to the queue before making an FTP destination selection
- http://screencast.com/t/SQW62GT6G

Later ... Charles

Rightload site - http://rightload.org/

PS In this multi-file upload scenario, Rightload copies multiple upload paths ( URLs ) to the clipboard.

Screencast ( no audio ) of multi-file copy, handling duplicate files and
clipboard pasting of multiple upload paths
- http://screencast.com/t/tYJ8PTTKQ
Logged
mouser
First Author
Administrator
*****
Posts: 33,409



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #17 on: September 15, 2008, 12:52:44 PM »

That's great cvbusa  thumbs up
Can i add a link to that screencast from SC page and from SC help file?
Logged
cvbusa
Charter Member
***
Posts: 32


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #18 on: September 15, 2008, 07:28:36 PM »

Hi mouser ... you are welcome to use the screencast as you see fit.

Below is a link to a "better" screencast that demonstrates the entire process. You are welcome to download this Flash .swf file to your local server ( just in case my hosting service changes in the future ).

Later ... Charles

Screencast ( no audio ) of using Rightload with Screenshot Captor :

- http://www.charlesbrown.c...tload-2008-09-15_1716.swf

Logged
mouser
First Author
Administrator
*****
Posts: 33,409



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #19 on: September 15, 2008, 08:12:08 PM »

Great, thanks  thumbs up
Logged
mouser
First Author
Administrator
*****
Posts: 33,409



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #20 on: September 15, 2008, 08:12:56 PM »

By the way everyone, rightload is donationware -- if you use it and like it, consider sending them a little donation as a way of saying thanks.  thumbs up
Logged
nafs
Supporting Member
**
Posts: 16


View Profile Give some DonationCredits to this forum member
« Reply #21 on: March 09, 2009, 06:53:22 AM »

I just found out that Rightload also supports the command line, which makes it even greater. Click here for instructions.
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.042s | Server load: 0 ]