Author Topic: about the FTP API  (Read 3115 times)

0 Members and 1 Guest are viewing this topic.

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
about the FTP API
« on: November 19, 2020, 08:24:08 pm »
.whoops i was going to move my post and  did not see you had already  replied
« Last Edit: November 19, 2020, 08:57:21 pm by NOVARSEG »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: In FTP are the bytes read determined by the FTP itself?
« Reply #1 on: November 19, 2020, 08:32:43 pm »
@NOVARSEG , is this a reply to my library? If so, you are allowed to ask it there. Or, for a quicker response, you can join the Discord server and ask any question about it and I will be able to see your questions sooner.

However, once again, I'm not so sure what it is you are asking. I'll take a stab at it, though. That function call is sending a 1024 byte (1 kilobyte) buffer read from the file to the FTP server.

I'll break the function down for you:
a: a is the return value of the boolean TRUE or FALSE from InternetWriteFile (the function which sends the buffer to the server).
hTransfer: hTransfer is the LONG handle to the session for writing to the file opened by FTPOpenFile
buffer: buffer is the 1024 (1 kilobyte) buffer read from the file
dwWrite: However many bytes are written to the server are then returned in that variable. You can use that to make sure that data is actually written.

I have no clue if I answered your question. If you need more help, reply at the FTP thread (or join the Discord) so when other people have questions then they can see what I answer as well. I'm going to paste the link to this thread in my FTP library thread so it can be found. Let's continue the discussion there.
https://www.qb64.org/forum/index.php?topic=3263.0
« Last Edit: November 19, 2020, 08:35:55 pm by SpriggsySpriggs »
Shuwatch!

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: .whoops
« Reply #2 on: November 19, 2020, 08:56:41 pm »
Ok thanks

you say
****
That function call is sending a 1024 byte (1 kilobyte) buffer read from the file to the FTP server.
****
Ok I'm not familiar with that type of file transfer. I thought the 1024 buffer size was referring to a memory space on your computer.


 OK sorry figured it out . there was 4 parameters  i thought there was 3
from here
http://speed.eik.bme.hu/help/html/Web_Programming_Unleashed/ch17.htm#WinInetFTPFunctions
****
BOOL InternetReadFile(

   IN HINTERNET  hFile,

   IN LPVOID     lpBuffer,

   IN DWORD      dwNumberOfBytesToRead,

   OUT LPDWORD   lpNumberOfBytesRead

);

The parameters for this function are as follows: :

hFile is a valid handle returned from a previous call to InternetOpenUrl(), FtpOpenFile(), GopherOpenFile(), or HttpOpenRequest().

lpBuffer is the address of a buffer that receives the data read from the file.
dwNumberOfBytesToRead is the number of bytes to read from the file.
lpNumberOfBytesRead is the address of a variable that receives the actual number of bytes read. If dwNumberOfBytesToRead is larger than the actual number of bytes in the file, use this parameter to determine the actual number of bytes read from file.

****


« Last Edit: November 19, 2020, 09:17:00 pm by NOVARSEG »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: about the FTP API
« Reply #3 on: November 19, 2020, 09:00:19 pm »
Shuwatch!

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: about the FTP API
« Reply #4 on: November 19, 2020, 09:13:28 pm »
k