Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTPPutFile

Status
Not open for further replies.

levinll

Programmer
Oct 29, 2001
65
US
According to the documentation that I can find about FTPPutFile, a return value of 1 indicates that the operation was successful. I was curious whether this means that the correct # of bytes were transferred or that just a file was created based on the passed parameter ?
 
levinll,

I'm not sure what do you mean. But let's look into the MSDN documentation. Here is the declaration:

BOOL WINAPI FtpPutFile(
HINTERNET hConnect,
LPCTSTR lpszLocalFile,
LPCTSTR lpszNewRemoteFile,
DWORD dwFlags,
DWORD dwContext);

It will only return TRUE (success) or FALSE (fail). If you use other languange (i.e: VB) maybe you have to cast the return value into other value (i.e.: long) then you will get 1 for TRUE, 0 for FALSE.

So it doesn't have any other means except indications of SUCCESS or FAIL

Regards

-- AirCon --
 
I'm trying to determine if SUCCESS means the file was transferred in it's entirety.
 
Well, I can't say too much in this case :)
I think you have to assumed that the file transfered succesfully, or you can try to call GetLastError(). Some of the API function "set" the last error with 0 if the function was succeed.


-- AirCon --
 
One more thing. If you need more control, you can use FtpOpenFile and InternetWriteFile. And after the file is written you can re-read the file (InternetReadFile) to confirm


-- AirCon --
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top