| View previous topic :: View next topic |
| Author |
Message |
icefreez
Joined: 15 May 2007 Posts: 39
|
Posted: Wed Jan 09, 2008 8:31 pm Post subject: Send to FTP, Copy URL to clipboard |
|
|
Ok this is my proposed task. It is something that I am sure would simplify the life of a anyone who owns a server
Task: Upload files from local computer to FTP server. Compute URL of newly uploaded files to clipboard.
Right now I can right click a file, select "Send To" and put the files on my FTP server. I still have to manually create the path to them though. (I know not alot of work, but I want to automate it)
I was thinking of integrating with an existing FTP client. Or maybe using the Command Prompt shell to automate the process. (don't know much about importing file names into a bat file). I am open to possible solutions.
Two free FTP programs that allow a Send to FTP option are:
WinSCP
Send to FTP
I also came across this post as well which describes FTPZillla, now called FireZilla as being able to do this. I installed FireZilla but was unable to find such an option. |
|
| Back to top |
|
 |
ManaUser
Joined: 24 May 2007 Posts: 906
|
Posted: Wed Jan 09, 2008 9:24 pm Post subject: |
|
|
| Can the URL be reliably determined from the original file names? For instance if you upload MyFile.html can you count on the URL being http://xyz.com/~blah/blah/MyFile.html? If so then wouldn't it be easier to figure out the URL from the filenames rather than trying to extract them from the FTP client? |
|
| Back to top |
|
 |
icefreez
Joined: 15 May 2007 Posts: 39
|
Posted: Wed Jan 09, 2008 9:33 pm Post subject: |
|
|
Ohh no I fully agree. I would not want to determine the file names from the FTP client. I just want two parts.
Upload selected files to FTP
Get Clipboard filled with valid URLs to new files.
I don't care how this is achieved. In my particular case it would always be the same directory they are saved in.
So say I upload two files. I won't know what they are called but lets say they are named a.txt and b.txt. I know I am going to always upload to www.autohotkey.com/files/ lets say. So if i can just figure out what files are selected and sent to the ftp client to upload into the /files/ directory I can just assume that I need to copy
http://www.autohotkey.com/files/a.txt
http://www.autohotkey.com/files/b.txt
to the clipboard.
Nothing smooth and fancy I am just looking for a rough hacked together way to get that done. |
|
| Back to top |
|
 |
icefreez
Joined: 15 May 2007 Posts: 39
|
Posted: Wed Jan 09, 2008 9:50 pm Post subject: |
|
|
I was able to figure it out somewhat using WinSCP's command line commands. http://winscp.net/eng/docs/commandline
| Code: | count = 0
Loop, %0% ; For each parameter:
{
param := %A_Index% ; Fetch the contents of the variable whose name is contained in A_Index.
list = %list% %param%
storeclip = %storeclip%`rhttp://www.autohotkey.com/David/%param%
count++
}
clipboard = %storeclip%
run, `"C:\Program Files\WinSCP\WinSCP.exe`" /upload %list% |
I am having two problems still. When storing to the clipboard I want to store a new line to the clipboard but `n or `r don't seem to work. Also I need to strip off the local path so its just the file name.
You place this in your documents and settings in the SendTo folder. EX C:\Documents and Settings\david\SendTo\ Of course you update the path to WinSCP if its different. |
|
| Back to top |
|
 |
|