Sometimes I need to download large files, so instead of saving ResponseStream to file, I change my code to use:
SslHttpRestData.HttpMemStrategy := HttpStratFile;
SslHttpRestData.HttpDownFileName := DiskFileName;
SslHttpRestData.HttpDownReplace := True;
The download is running and takes quite some time for large files, but the saved file is very often only 24576 bytes in size.
09:48:24 < HTTP/1.1 200 OK
09:48:24 < Content-Length: 144538644
09:48:24 < Content-Type: audio/mpeg
09:48:24 < Server: Microsoft-IIS/10.0
09:48:24 < Strict-Transport-Security: max-age=2592000
09:48:24 < X-Powered-By: ASP.NET
09:48:24 < Date: Tue, 30 Apr 2024 07:48:23 GMT
09:48:24 Opened new file OK: E:\store\2504.mp3.part
09:48:24 https:***2504.mp3, Downloading 0 of 138M
09:48:26 https:***2504.mp3, Downloading 27,0M of 138M
09:48:28 https:***2504.mp3, Downloading 61,3M of 138M
09:48:30 https:***2504.mp3, Downloading 97,5M of 138M
09:48:32 https:***2504.mp3, Downloading 125M of 138M
09:48:32 Request completed: 200 OK
09:48:32 Saved File OK: E:\store\2504.mp3, Size: 138M
09:48:32 https:***202504.mp3, Request completed, Size: 138M
A correct file size is reported but that is not true.
Disk space is no problem, using version 9.1 with Delphi 12.
Am I doing something wrong, or what?
Bert