Discussion:
FtpGetFileSize() returns incorrect size for files over 4 gig
(too old to reply)
SuperBK
2007-12-03 17:39:22 UTC
Permalink
I have searched and only found one mention of this. I find it amazing
that such a blatant bug could still exist. When I use Wininet's
FtpGetFileSize() the size returned is incorrect for a file larger than
4.2 Gig. My file is (7,119,037,160 bytes), FtpGetFileSize() returns
4294967295 for the low size and 0 for the high size. Also,
FtpFindFirstFile() doesn't return the correct size either.

The data back from the ftp server, as seen in the ftp command line
client looks like this:
213 7119037160
which is the exact size of my file.

Is there any workaround? Use an ftp client that doesn't use Wininet?

Thanks,
Brian
Volodymyr Shcherbyna
2007-12-04 07:25:34 UTC
Permalink
Yes. I guess, it uses dword to retrieve the file size, so bigger sizes are
not supportable. You can write a small wraper of winsock functions to
support FTP protocol. This is quite often approach. For example, FarFtp.dll
plugin for Far manager DOES NOT use wininet functions, it uses winsock
directly. You can even take a look at it's interface, maybe you can use it.
Of course, if it's allowed in license agreement.
--
Volodymyr
Post by SuperBK
I have searched and only found one mention of this. I find it amazing
that such a blatant bug could still exist. When I use Wininet's
FtpGetFileSize() the size returned is incorrect for a file larger than
4.2 Gig. My file is (7,119,037,160 bytes), FtpGetFileSize() returns
4294967295 for the low size and 0 for the high size. Also,
FtpFindFirstFile() doesn't return the correct size either.
The data back from the ftp server, as seen in the ftp command line
213 7119037160
which is the exact size of my file.
Is there any workaround? Use an ftp client that doesn't use Wininet?
Thanks,
Brian
Loading...