Script to upload folder via FTPS??

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
TXShooter
Posts: 165
Joined: 13 Dec 2017, 09:27

Script to upload folder via FTPS??

05 Jan 2018, 09:02

I'm getting lost in the forest again and need a compass from the sage gurus here.

I record off of a Berhringer X32 Compact using Reaper at Office 1 and then send that to Office 2 for processing. A lot of that processing can be automated, and with AHK I've had a lot of success in doing that (some still requires manual button pressing, but for the most part, it's come a long way). The next step in my automation process is to get the files sent TO Office 2 automatically after recording ends. Right now I've been somewhat automatically (through another AHK script) using one of the cloud services to do this... it's slow and has a size limit, and that's why I'm seeking an alternative.

Prior to doing all of this and for other purposes, I have Filezilla set up with a secure certificate (FTPS) that is currently being used manually to upload other files for offsite archiving.

Is there a way to add to an existing script so that I can just upload these recordings via FTPS to Office 2 (with or without Filezilla Client)?

I've tried searching for this answer, but I'm getting lost in the different types of applications and certificate and FPTS vs SFTP and folder vs file and appending and... it's all getting so convoluted that I can't tell what I need to do... but I do know that I need guidance to at least get started.

FYI... Office 1's computer is an older 32bit laptop stuck running Win7, if that even applies.

Many thanks to you that work so hard to help those of us stuck in the trees.
TXShooter
Posts: 165
Joined: 13 Dec 2017, 09:27

Re: Script to upload folder via FTPS??

05 Jan 2018, 13:25

Lost in the forest, Bob attempts to light the way with the only match left in his pocket, and a tiny fluttering breeze from a moth extinguishes his hopes.
Guest

Re: Script to upload folder via FTPS??

05 Jan 2018, 15:04

I have no idea if this works, but if you can transfer files with WinSCP you may be able to use the https://github.com/lipkau/WinSCP.ahk library to automate transfers ?
TXShooter
Posts: 165
Joined: 13 Dec 2017, 09:27

Re: Script to upload folder via FTPS??

05 Jan 2018, 17:01

Guest wrote:I have no idea if this works, but if you can transfer files with WinSCP you may be able to use the https://github.com/lipkau/WinSCP.ahk library to automate transfers ?
I haven't tried using WinSCP before.
TXShooter
Posts: 165
Joined: 13 Dec 2017, 09:27

Re: Script to upload folder via FTPS??

18 Mar 2018, 13:34

I can't seem to get this to install correctly... I keep getting an error just registering the DLL file.
mikek
Posts: 11
Joined: 30 Sep 2013, 17:17

Re: Script to upload folder via FTPS??

19 Mar 2018, 18:42

I do not believe that AHK has built in support for FTP, SFTP, or FTPS. If your transfers must be done using FTPS, you could probably use the scheduling feature of WS_FTP to do this. WS_FTP is not free, though, and is not an "AHK solution".

If standard FTP is acceptable, you may control the built-in FTP functionality of Windows using AHK. I do this by using AHK to create a ".scr" file (ftp script), and then run the script. I'm sure there is a better way of doing this, but sample code is below.

Code: Select all

/*

Example Usage:
	server := ""
	username := ""
	password := ""
	fileName := "test.jpg"
	destPath := "/test"
	fPut(server, username, password, fileName, destPath)

*/

; Put FTP File
fPut(server, username, password, fileName, destPath)
	{
	;
	; ----- Prepare BAT File -----
	;
	scrFile := "FTP_Auto_Upload_" A_Now ".scr"
	FileDelete, %scrFile% ; Attempt to delete leftover files
		
	;
	; ----- Prepare SCR File -----
	;
	scrContent := ""
	scrContent := scrContent "open " server "`n"	; Open connection to our ftp server.
	scrContent := scrContent username "`n"			; Enter user name.
	scrContent := scrContent password "`n"			; Enter password.
	scrContent := scrContent "hash`n"				; Turn on hash marks.
	scrContent := scrContent "bin`n"				; Binary mode.
	;scrContent := scrContent "literal pasv`n"		; Enter passive mode.
	If (destPath != "")
		scrContent := scrContent "cd " destPath "`n" ; Change directory.
	scrContent := scrContent "put " fileName "`n"	; Upload the file.
	scrContent := scrContent "bye`n"				; Close ftp connection.
	FileAppend, %scrContent%, %scrFile%
	Sleep, 500
	
	;
	; ----- Upload Files -----
	;
	;Runwait, ftp -s:%scrFile%
	Runwait, ftp -s:%scrFile%, , Min
	FileDelete, %scrFile%
	IfExist, %scrFile%
		{
		Loop, 10
			{
			FileDelete, %scrFile%
			Sleep, 100
			}
		}
	}
For SFTP transfers, I use AHK to prepare a .env file with parameters for a Ruby script.

- Mike
TXShooter
Posts: 165
Joined: 13 Dec 2017, 09:27

Re: Script to upload folder via FTPS??

19 Mar 2018, 19:39

I am currently using Filezilla with FTP over TLS (FTPS) and I do have the server set up to allow explicit FTP over TLS. What I am attempting to do is upload an entire folder over this FTP connection, and I am so lost in trying to build a script.

In looking over your example, I'm not sure it would work due to the SSL / TLS setup. Have you tried that with your SCR generator?
TXShooter
Posts: 165
Joined: 13 Dec 2017, 09:27

Re: Script to upload folder via FTPS??

24 Mar 2018, 06:20

I've been looking at this since you gave me the link, and I can't see how it works with folders without some kind of loop sequence. Also, is there a way to encrypt the password for this tool?
BNOLI
Posts: 548
Joined: 23 Mar 2020, 03:55

Re: Script to upload folder via FTPS??

07 Apr 2020, 12:47

The current version supports the FTP, FTPS, SFTP, HTTP, HTTPS and WebDAV protocols including direct (FXP) and indirect (protocol independent) server-to-server transfers, request scheduling and resumption, properties inheritance, command line interface, file filters, overwrite rules, transparent windows and much more!
http://www.bitkinex.com/features (update to the above-mentioned description) 8-)
Remember to use [code]CODE[/code]-tags for your multi-line scripts. Stay safe, stay inside, and remember washing your hands for 20 sec !

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 353 guests