Jump to content


Photo

Download File method signature different in COM and .NET


  • Please log in to reply
1 reply to this topic

#1 ssjv

ssjv
  • Members
  • 1 posts

Posted 11 February 2008 - 05:48 AM

I am trying to download a file a lot larger than 3 GB using FTPLibrary. This is a prototype I am checking before recommending the purchase by my Client. The problem I am seeing is the the documentation shows for IFTPConnection.Downloadfile the signature is HRESULT DownloadFile(
[in] BSTR szRemoteFile,
[in] BSTR szLocalFile,
[in] long nStartPosLo,
[in] long nStartPosHi,
[out, retval] enumError * retval
);
However when I am trying to use this from .NET I am seeing nStartPosLo and nStartPosHi as int and the size of my file is larger than the int.

I am using FTPConnectionMTA and then DownloadFile method which is showing the signature as int. Also the public properties for LastFileSizeLo and High are returning int as well. Can you please let me know how I should handle files larger than the size the integer can hold.
Thank you

#2 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 11 February 2008 - 12:41 PM

Hello ..

The nStartLo and nStartHi arguments are only needed if you want to restart/resume a file transfer. In this case you put the lo 32 bits of the int64 into the nStartLo and the high 32 bits into the nStartHi:

Int64 nStart;

DownloadFile(x,y, nStart & 0xffffffff, nStart >> 32)

Regards,
Mat




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users