Results 1 to 4 of 4

Thread: Number of Bytes Only Show First Time Using FTPGETFILE

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2016
    Posts
    33

    Number of Bytes Only Show First Time Using FTPGETFILE

    I have a routine using FTPGETFILE which displays the number of Bytes being downloaded in a listbox. The number of bytes also shows up in a Progressbar and a Picturebox (I'm testing several items). The number of Bytes being downloaded is being retrieved from the MOVEMEMORY API Function. All 3 of these will work correctly and display correctly the first time I download a file, but they don't work when I try to download the same file after the first time. In other words, download 2, 3, 4, etc. of the same file doesn't display the number of bytes. I'm guessing this has something to do with the file being in memory somewhere? I have tried using different flags such as 1.) FILE_ATTRIBUTE_ARCHIVE and 2.) INTERNET_FLAG_RELOAD Or INTERNET_FLAG_NO_CACHE_WRITE but nothing seems to work. Suggestions? Thanks in advance for any help.

  2. #2
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,654

    Re: Number of Bytes Only Show First Time Using FTPGETFILE

    Would really need to see the exact problem in code to offer an accurate solution. And is it saying it downloaded 0 bytes, or just an incorrect number of bytes? Is there maybe a resource/handle not being freed at the end of the function?

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2016
    Posts
    33

    Re: Number of Bytes Only Show First Time Using FTPGETFILE

    Not sure. The code is intertwined with other things (for various reasons) that it would be hard to post. I am still looking for a solution. I don't understand why MoveMemory seems to work fine for Downloading but not Uploading as far as extracting the Bytes that are being move.

  4. #4
    Member Dragokas's Avatar
    Join Date
    Aug 2015
    Location
    Ukraine on fire (country of slaves)
    Posts
    750

    Re: Number of Bytes Only Show First Time Using FTPGETFILE

    To try to estimate the problem, you can post lines with key functions only, like FtpGetFile / HttpOpenRequest / maybe callback routine + declarations of functions and used constants.
    work fine for Downloading but not Uploading as far as extracting the Bytes that are being move.
    Not quite understandable, if the problem occurs during downloading (FtpGetFile) or in some other function for uploading ...
    Malware analyst, VirusNet developer, HiJackThis+ author || my CodeBank works

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width