FUNCTION local2ftp (hConnect, lcSource, lcTarget) * copying local file to the remote target hSource = FOPEN (lcSource) IF (hSource = -1) RETURN -1 ENDIF * this call creates a new remote file hTarget = FtpOpenFile(hConnect, lcTarget, GENERIC_WRITE,; FTP_TRANSFER_TYPE_BINARY, 0) IF hTarget = 0 = FCLOSE (hSource) RETURN -2 ENDIF lnBytesWritten = 0 lnChunkSize = 256 && 128, 512 and even 16384 are good DO WHILE Not FEOF(hSource) lcBuffer = FREAD (hSource, lnChunkSize) lnLength = Len(lcBuffer) IF lnLength > 0 IF InternetWriteFile (hTarget, @lcBuffer, lnLength, @lnLength) = 1 lnBytesWritten = lnBytesWritten + lnLength * at this point you can display the progress * and test events: keyboard, mouse etc. * to decide on aborting the upload ?? "·" && you can put link to a progress bar here instead ELSE EXIT ENDIF ELSE EXIT ENDIF ENDDO = InternetCloseHandle (hTarget) = FCLOSE (hSource) RETURN lnBytesWrittenCheck also: