|
@@ -1746,7 +1746,7 @@ end;</pre></example>
|
|
|
<name>DownloadTemporaryFile</name>
|
|
|
<prototype>function DownloadTemporaryFile(const Url, FileName, RequiredSHA256OfFile: String; const OnDownloadProgress: TOnDownloadProgress): Int64;</prototype>
|
|
|
<description><p>Downloads the file from the specified URL to a temporary directory using the specified name. To find the location of the temporary directory, use <tt>ExpandConstant('{tmp}')</tt>.</p>
|
|
|
-<p>An exception will be raised if the file wasn't downloaded successfully. Otherwise, returns the number of bytes downloaded.</p>
|
|
|
+<p>An exception will be raised if there was an error. Otherwise, returns the number of bytes downloaded.</p>
|
|
|
<p>Supports HTTPS (but not expired or self-signed certificates) and HTTP. Redirects are automatically followed and proxy settings are automatically used. Safe to use from services.</p>
|
|
|
<p>If RequiredSHA256OfFile is not empty it will compare this to the SHA-256 of the downloaded file and raise an exception if the hashes don't match.</p>
|
|
|
<p>Set OnDownloadProgress to a function to be informed of progress, or <tt>nil</tt> otherwise.</p></description>
|
|
@@ -1754,7 +1754,8 @@ end;</pre></example>
|
|
|
<p><tt>TOnDownloadProgress = function(const Url, FileName: string; const Progress, ProgressMax: Int64): Boolean;</tt></p>
|
|
|
<p>ProgressMax will be 0 if the file size is still unknown. Return True to allow the download to continue, False otherwise.</p>
|
|
|
<p>For basic authentication use a special URL format like this: http://username:[email protected]/</p></remarks>
|
|
|
- <seealso><p><link topic="isxfunc_ExtractTemporaryFile">ExtractTemporaryFile</link></p></seealso>
|
|
|
+ <seealso><p><link topic="isxfunc_DownloadTemporaryFileSize">DownloadTemporaryFileSize</link><br />
|
|
|
+<link topic="isxfunc_ExtractTemporaryFile">ExtractTemporaryFile</link></p></seealso>
|
|
|
<example><pre>
|
|
|
[Code]
|
|
|
function OnDownloadProgress(const Url, Filename: string; const Progress, ProgressMax: Int64): Boolean;
|
|
@@ -1779,6 +1780,13 @@ begin
|
|
|
end;</pre>
|
|
|
<p>See <i>CodeDownloadFiles.iss</i> for another example.</p></example>
|
|
|
</function>
|
|
|
+ <function>
|
|
|
+ <name>DownloadTemporaryFileSize</name>
|
|
|
+ <prototype>function DownloadTemporaryFileSize(const Url): Int64;</prototype>
|
|
|
+ <description><p>Returns the size of the file from the specified URL, without downloading the file. If the server does not provide the file size, -1 will be returned.</p>
|
|
|
+<p>An exception will be raised if there was an error.</p>
|
|
|
+<p>See <link topic="isxfunc_DownloadTemporaryFile">DownloadTemporaryFile</link> for other considerations.</p></description>
|
|
|
+ </function>
|
|
|
</subcategory>
|
|
|
<subcategory>
|
|
|
<function>
|