topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 7:38 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: SOLVED: Attach or upload to FTP utility  (Read 6407 times)

huismus

  • Participant
  • Joined in 2012
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
SOLVED: Attach or upload to FTP utility
« on: October 01, 2012, 01:31 AM »
Hello everyone,

I recently moved abroad and email is a huge part of staying in touch with friends and family back home. I'd like to more efficiently upload pictures (and other files) to them. I use AHK to create some keyboad shortcuts, but nothing you could call "programming". From searching the forum, I know that most components I think are needed to create this utility are available, but I have no idea how to put it together.

So here goes... The "Attach or upload to FTP utility" should do the following:
Whenever I drag and drop a file onto a MS Outlook message window, a window should pop-up giving me two options:
1. Upload file to FTP
2. Attach to email
If I choose 2, the file gets attached and nothing else happens.
If I choose 1, the following happens:
- A small FTP browser window opens a pre-determined FTP site
- I can browse to a desired folder or create a new one
- By clicking "upload", the file gets uploaded, and a link to the folder (i.e. the location of the file) gets pasted into the message body

That's it! Nice additions to this functionality would be:
- Drag and drop multiple files onto the MS Outlook message window
- A threshold for minimum filesize (so the utility doesn't pop up for small files)
- Checking the "To" field of the message to determine if the utility should pop-up (so you only send FTP uploaded attachment mails to recipients with FTP access).

I'm looking forward to your ideas!

Huismus
« Last Edit: October 01, 2012, 01:40 AM by huismus »

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: IDEA: Attach or upload to FTP utility
« Reply #1 on: October 05, 2012, 01:44 AM »
Welcome to the site, huismus.  The biggest obstacle in your idea is almost certainly going to be trying to capture that drag & drop event.  Personally, I don't think it can be done elegantly from outside of MS Outlook.

huismus

  • Participant
  • Joined in 2012
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Attach or upload to FTP utility
« Reply #2 on: October 12, 2012, 04:05 AM »
Thanks for the reply Skwire. I've been trial-and-erroring a lot with the drag-and-drop issue. I came up with the following workaround:
~LButton::
    KeyWait, LButton, T0.5
    if ErrorLevel ; timed-out (Button is not yet released after more then 0,5 s.)
{
   Keywait,Lbutton ; Watch for buttonrelease
   Sleep, 100 ; Wait for the message window to become active after drop (this might be unnescessary)
   WinGetActiveTitle, Title
   IfInString, Title, Message ; Check if active window is an outlookmessage
        MsgBox This is where an FTP GUI should appear
}
return

(Thanks to Lexikos)

I then found that this would also trigger when the message window was being dragged or resized. That's why I added a WinGetActiveTitle comparison as follows:
~LButton::
    KeyWait, LButton, T0.5
    if ErrorLevel ; timed-out (Button is not yet released after more then 0,5 s.)
{
   WinGetActiveTitle, Prev_Title
   Keywait,Lbutton ; Watch for buttonrelease
   Sleep, 100 ; Wait for the message window to become active after drop (this might be unnescessary)
   WinGetActiveTitle, Title
   IfEqual Title, %Prev_Title%
      Return
   IfInString, Title, Message ; Check if active window is an outlookmessage
        MsgBox This is where an FTP GUI should appear
}
return

Now, this is just a workaround... It'd be great if I could somehow "see" there's a file hanging on the tip of the mousepointer. Especially if I want to drag&drop multiple files onto the message window. I appreciate any input you might have

huismus

  • Participant
  • Joined in 2012
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Attach or upload to FTP utility
« Reply #3 on: November 09, 2012, 03:32 AM »
I found a solution in OutDisk FTP

Which does what I want, in a slightly different way.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: IDEA: Attach or upload to FTP utility
« Reply #4 on: November 09, 2012, 08:59 AM »
Very nice.  Thanks for reporting back.    :Thmbsup:

wr975

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 369
    • View Profile
    • Donate to Member
Re: SOLVED: Attach or upload to FTP utility
« Reply #5 on: January 11, 2013, 03:40 AM »
A little late, but perhaps someone will find it useful.

Nowadays I just use Dropbox to exchange files with family/friends.

But before Dropbox I used "DropUpload". It allows to create "locked" versions of itself. Start the tool, drag files on it and they'll get uploaded to your FTP. Very easy for family or friends to upload files to your server.

dropuploadeng.gif