Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

FTP functions library (Object syntax) [DEPRECATED]


  • Please log in to reply
39 replies to this topic
shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006

@shajul: the code is still wrong.


thanks fincs. my bad. i was busy, but seeing the glaringly obvious mistake, i replied immediately :oops:
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006

But if a real asynchronous upload is possible, even better :)

Asynchronous mode added. Please read the asynchronous mode notes in the documentation before using.
Also note that FTP_Init() has one more optional parameter. Also, .CloseHandle (an alias for .CloseSocket) accepts an optional parameter, the handle to close.

It works fine on a 64bit Windows and AHK_L x64, but in InternetReadFile() the filenames in the progress dialog are in the wrong order ("local file -> file on server").

Corrected!
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

fragman
  • Members
  • 1591 posts
  • Last active: Nov 12 2012 08:51 PM
  • Joined: 13 Oct 2009
Very nice, I will test it ASAP.

G00dMan
  • Members
  • 3 posts
  • Last active: Apr 03 2013 09:32 AM
  • Joined: 08 Jan 2011
Hello guys!
First thanks for your great job!
This lib is very useful for me and I plan to play a bit ;-)
But my question indeed is is there by any chance a way we to use SFTP?
In many busyness tasks we have to use sftp links or ssh so will be great improvement to have something for this.

Best regards!

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006

But my question indeed is is there by any chance a way we to use SFTP?


You can use libcurl. This forum has some libcurl wrappers that can be used as examples to get you started.
one wrapper -> <!-- m -->http://www.autohotke...topic32019.html<!-- m -->
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

Takuya
  • Guests
  • Last active:
  • Joined: --
Hey guys,

really nice work!

I got a problem with my Proxy here in the company, as it requires a separate authentication.

My Filezilla Proxy Config looks like this:
USER %u@%h %s
PASS %p
ACCT %w

which translates into

USER FTP-Username@FTP-Server Proxy-User
PASS FTP-Password
ACCT Proxy-Password

%u=FTP-Username
%h=FTP-Server
%s=Proxy-User
%p=FTP-Password
%w=Proxy-Password

Any way I can get that going with the FTP library or in general with AHK?

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006
You can use ftp.exe as the example shown in FileAppend

If you want to use this library, you'll have to use a yet unimplemented FTPCommand function

user

Specifes a user to the remote computer.
Syntax: user user-name [password] [account]

Parameter(s):
user-name - Specifies a user name with which to log in to the remote computer. 
password - Specifies the password for user-name. If not specified, but required, ftp prompts for the password. 
account - Specifies an account with which to log on to the remote computer. If account is not specified, but required, ftp prompts for the account.
Ref : <!-- m -->http://www.nsftools.com/tips/MSFTP.htm<!-- m -->
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

Takuya
  • Guests
  • Last active:
  • Joined: --
Thanks for the hint, I'll try that!

fragman
  • Members
  • 1591 posts
  • Last active: Nov 12 2012 08:51 PM
  • Joined: 13 Oct 2009
There's an error in this library in GetCurrentDirectory().
The lpdwCurrentDirectory parameter of FTPGetCurrentDirectory is the size of the buffer in TCHARs, not in bytes, so it needs to be 260.
Simply insert this line before the call to the function to make it work:
nSize := 260 ;lpdwCurrentDirectory is in TCHARs

I noticed the problem only on x64 Unicode for some reason, but with this fix it works for me.

Albireo
  • Members
  • 558 posts
  • Last active: Dec 13 2019 02:02 PM
  • Joined: 01 Feb 2006

Thanks for the FTP-library!

 

When used in conjunction with Windows XP, displayed no time or date on the files, but correct size on the files.

Result Example .:

Name: test.zip
CreationTime : 0
LastAccessTime : 0
LastWriteTime : 0
Size : 230424
Attribs : N

When used in conjunction with Windows 8 Pro 64bit, the time and date on the files are in right form, but the size of the files is wrong.

 

Result Example .:

Name: test.zip
CreationTime : 9/9/2014 22:20:59
LastAccessTime : 9/9/2014 22:20:59
LastWriteTime : 9/9/2014 20:21:59
Size : 6889127773210
Attribs : N

Although the date and time in Windows 8, I think it's weird that "Last Write Time" is before the "CreationTime" (but it might have its explanation).

 

Is it difficult to solve these problems?
Is that the same results with win7 64-bit?

 

//Jan

 

//Jan