how to fileappend CSV file on a FTP server and update it every min

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Yatendra3192
Posts: 89
Joined: 10 Dec 2017, 06:57

how to fileappend CSV file on a FTP server and update it every min

18 Mar 2018, 08:14

Hi All,

I have a script that update CSV file every min to check if user is active or idle. it's doing it successfully with fileappand commend on my local disk.

But i want to fileappend this CSV file on a FTP server i have user ID and password of that server but have no idea on how to write script to do that :?

Just thinking about FTP server and HTTP Server it make my head spin :crazy: can anyone help me with the code i put in my script to and it will conect to the ftp and update the file in the background :oops:
User avatar
Jovannb
Posts: 268
Joined: 17 Jun 2014, 02:44
Location: Austria

Re: how to fileappend CSV file on a FTP server and update it every min

18 Mar 2018, 10:56

Hi,

I would try it using WINSCP https://winscp.net/eng/docs/scripting and its powerfull commandline options

J.B.
AHK: 1.1.37.01 Ansi, 32-Bit; Win10 22H2 64 bit, german
mikek
Posts: 11
Joined: 30 Sep 2013, 17:17

Re: how to fileappend CSV file on a FTP server and update it every min

19 Mar 2018, 19:00

Glancing at what Jovannb showed, I like what I see.

Alternatively, (and without having more than glanced at the tool Jovannb shared), if you install NetDrive, you can access remote FTP sites as if they were just another local drive on your computer. The script you already wrote will work on a remote FTP site if NetDrive is installed and a drive letter is assigned to the FTP site. The current version is a paid for version. If cost is an issue, older versions are free (1.x versions).

- Mike
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: how to fileappend CSV file on a FTP server and update it every min

20 Mar 2018, 00:41

Hello.
Uploading a file was a huge issue, till I solved. In help file the locale coding was missing.
As the ftp function with comspec is a windows function, the code for the locale was necessary, but not documented. Look example below:

Code: Select all

VarMitNamenDerZieldatei=D:\Files\members.csv
FTPBefehlDatei = %A_ScriptDir%\FTPBefehle.txt
FTPLogDatei = %A_ScriptDir%\FTPLog.txt
FileDelete %FTPBefehlDatei%  ; Falls das vorherige Ausführen vorzeitig beendet wurde.
; ATTENTION ATTENTION - Maybe you must erase (delete) the comment inside the brackets
(
open ftp.NameOfMyWebsite.net
NameOfMyWebsite.net
********** <---  your password to access your host
binary
cd tracking ; this line is only necessary, if you have a subfolder. In this case, my subfolder name was "Tracking"
delete members.csv
put %VarMitNamenDerZieldatei%
bye
), %FTPBefehlDatei%, CP1252 ; <-- change this to your locale 
RunWait %comspec% /c ftp.exe -s:"%FTPBefehlDatei%" >"%FTPLogDatei%"
FileDelete %FTPBefehlDatei%  ; Löscht sie aus Sicherheitsgründen.
Run %FTPLogDatei%  ; Zeigt das Protokoll zum Untersuchen an.
So you can now, after creating your csv-file and storing it localy, upload it to a host of your choice.
Look here for Codepages of different locales.
Einfach nur ein toller Typ. :mrgreen:
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: how to fileappend CSV file on a FTP server and update it every min

20 Mar 2018, 00:58

mikek wrote:Glancing at what Jovannb showed, I like what I see.

Alternatively, (and without having more than glanced at the tool Jovannb shared), if you install NetDrive, you can access remote FTP sites as if they were just another local drive on your computer. The script you already wrote will work on a remote FTP site if NetDrive is installed and a drive letter is assigned to the FTP site. The current version is a paid for version. If cost is an issue, older versions are free (1.x versions).

- Mike
Thx for that recommendation! Last freeware version 1.3.4 - [Download] :)
mikek
Posts: 11
Joined: 30 Sep 2013, 17:17

Re: how to fileappend CSV file on a FTP server and update it every min

20 Mar 2018, 17:43

It does not appear that Bitkinex supports drive mapping. I could not find the feature, and per this review linked below, "it lacks the dead-simple interface of a mapped drive".

https://lifehacker.com/5623582/bitkinex ... or-windows

- Mike
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: how to fileappend CSV file on a FTP server and update it every min

21 Mar 2018, 01:36

mikek wrote:It does not appear that Bitkinex supports drive mapping. I could not find the feature, and per this review linked below, "it lacks the dead-simple interface of a mapped drive".

https://lifehacker.com/5623582/bitkinex ... or-windows

- Mike
At the end of that articles comment section(?) it's said that NetDrive is free of charge for personal/private use. So, go for that. :thumbup:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: ntepa, scriptor2016, supplementfacts and 143 guests