Code:uses WinInet, ComCtrls, Forms, Windows, SysUtils;thats probably the bit u need to focus on and i dont want to use components to do this for meCode:while iBuffSize > 0 do Begin if iFileSize - iBytesWritten < iBuffWriteSize then Begin SetLength(arrBuffer, iFileSize - iBytesWritten); iBuffWriteSize := iFileSize - iBytesWritten; end; BlockRead(fLocalFile, arrBuffer[0], iBuffWriteSize); if (iBuffSize > 0) and (iBuffSize <= iBuffWriteSize) then if not InternetWriteFile(hRemoteFile, @arrBuffer, iBuffWriteSize, iBuffSize) then Begin Result := -7; // error writing file Break; end else else Begin Result := 1; // end of file Break; end; iBytesWritten := iBytesWritten + iBuffSize; ProgressBar.Position := iBytesWritten; Application.ProcessMessages; end;
Bookmarks