Skip to content

Latest commit

 

History

History
64 lines (44 loc) · 1.7 KB

File metadata and controls

64 lines (44 loc) · 1.7 KB

Home

Function name : InternetWriteFile

Group: Internet Functions (WinInet) - Library: wininet


Writes data to an open Internet file.


Code examples:

Uploading file to the FTP server using InternetWriteFile
Custom FTP Class for Visual FoxPro application

Declaration:

BOOL InternetWriteFile(
    HINTERNET hFile,
    LPCVOID lpBuffer,
    DWORD dwNumberOfBytesToWrite,
    LPDWORD lpdwNumberOfBytesWritten
);
  

FoxPro declaration:

DECLARE INTEGER InternetWriteFile IN wininet;
	INTEGER   hFile,;
	STRING  @ sBuffer,;
	INTEGER   lNumBytesToWrite,;
	INTEGER @ dwNumberOfBytesWritten  

Parameters:

hFile [in] Valid HINTERNET handle returned from a previous call to FtpOpenFile or an HINTERNET handle sent by HttpSendRequestEx.

lpBuffer [in] Pointer to a buffer that contains the data to be written to the file.

dwNumberOfBytesToWrite [in] Unsigned long integer value that contains the number of bytes to write to the file.

lpdwNumberOfBytesWritten [out] Pointer to an unsigned long integer variable that receives the number of bytes written to the buffer.


Return value:

Returns TRUE if the function succeeds, or FALSE otherwise.


Comments:

This function is convenient when you want to store a local file on the FTP copying it as a series of relatively small pieces. In this case you can stop, suspend or abort the process and display its progress using the intervals between sending pieces.