OK,
I have a program that uploads a file via FTP. Using the standard FTP API FtpPutFileA I can upload the file and specify the transfer type. So I started to get fancy because I wanted a progress bar for uploading and down loading. I found a few examples of how to do this. Here is the short version of what I found.
VB Code:
'&H40000000 == GENERIC_WRITE ' for ASCII files use FTP_TRANSFER_TYPE_ASCII hFile = FtpOpenFile(m_hSession, RemoteFile, &H40000000, dwType, 0) If (InternetWriteFile(hFile, Data(0), 100, Written) = 0) Then
So were do I use FTP_TRANSFER_TYPE_ASCII in the FtpOpenFile command. I have tried the API constants and it always returns a failure. When I am doing this type of work, do I have to specify the transfer type in the InternetConnect API?
My belief is that the dwtype is where I need to set the transfer type flag. In testing, I uploaded a pdf using FTP_TRANSFER_TYPE_ASCII and I confirmed that the uploaded file was not the same size in bytes as the original. I then downloaded the file with the MS ftp command program in binary mode. Acrobat reader said repairing, and it did open the file after several seconds. However, I uploaded an application in ASCII mode in the FtpOpenFile API and then downloaded with MS ftp command program in binary mode and saw what I expected to see, errors.
I guess, the short question is, is that the correct field (dwType) to set in the FtpOpenFile to specify the transfer type.
Thank you for all responses
