Sign in to follow this  
Followers 0
PcExpert

InetGetSize works slow

14 posts in this topic

Hello,

I use InetGetSize to check for an update for my program. But when I try to check a filesize on my FTP Server it takes more then a minute to get the size. What's wrong?

Thanks,

PcExpert

Share this post


Link to post
Share on other sites



Would you call a doctor and say "I'm sick, send me medicine" and then hang up?

I'll give you a cookie if you can provide any less useful information than what you've provided so far.

Share this post


Link to post
Share on other sites

What kind of cookie?

Share this post


Link to post
Share on other sites

Chocolate chip and asbestos.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I have used the code like this:

But just that takes more then a minute

Here's a part of the code:

$size = InetGetSize("ftp://username:password@ipadress/files/update.exe")

If $size = "212435" Then

TrayTip("Updater", "Er zijn momenteel geen updates voor dit bestand", "", "")

Sleep(5000)

Else

InetGet("ftp://username:password@ipadress/files/update.exe", "update.exe", 1, 1)

Edited by PcExpert

Share this post


Link to post
Share on other sites

The code appears syntactically correct.

Does downloading it take a long time, too? Have you tried creating a 0-byte file on the server and getting the size of it? What about trying to download a 0-byte file? Does that take a minute, too?

Share this post


Link to post
Share on other sites

Downloading goes fast. So there's no problem with downloading the files. Only the InetGetSize works slow.

Share this post


Link to post
Share on other sites

Which version(s) of AutoIt have you tried? Try version 3.1.1.0 and the latest beta. Do both of them behave the same? Do both of them download the file fast?

Share this post


Link to post
Share on other sites

OK, now I have installed the latest beta it woeks some faster, but it still takes 40 or 50 second to get the filesize.

Share this post


Link to post
Share on other sites

Can you find a publicly available server that demonstrates the same problem? Otherwise, it sounds to like you have some sort of issue with your FTP server. Are you connecting to the server via an IP or hostname? Try both, are both slow?

Really, I can't think of anything in AutoIt that could be slowing things down and nobody has ever reported a problem like this that I can remembered so I think the problem is on your end somewhere.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

actually i have the same problem with my works ftp site, the way i got around it was to create a separate .txt file with the filesize of the file i wanted, download the txt file and read it, it does seem on some ftp servers that inetgetsize await ftp timout before returning hope this helps Rick

Edited by Rick

Who needs puzzles when we have AutoIt!!

Share this post


Link to post
Share on other sites

That sounds like a problem with the FTP server trying and failing to do a DNS lookup on the incoming client. I had a similar problem with my router and SSH connections. You can fix the problem by adding your computer's IP address and name to the hosts file on the remote machine. There's probably an underlying configuration issue that needs fixed that would render the hosts file fix redundant.

Without an FTP server on which to test, there's really nothing we can do.

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

adding an ip address on the ftp server is out of the question as that'll be unknown, as our customers access the site and we have no knowledge of their i.p address's

not sure if its any help but we use fileZilla server v0.9.17

Edited by Rick

Who needs puzzles when we have AutoIt!!

Share this post


Link to post
Share on other sites

OK, thanks all for your help and I shall try it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0