diff --git a/lib/download.gi b/lib/download.gi index 1e01b2e..42a5d57 100644 --- a/lib/download.gi +++ b/lib/download.gi @@ -44,7 +44,11 @@ Add( Download_Methods, rec( res:= ValueGlobal( "DownloadURL" )( url, opt ); if res.success = true and - IsBound( opt.target ) and IsString( opt.target ) then + IsBound( opt.target ) and IsString( opt.target ) and + IsBound( res.result ) then + # 'DownloadURL' ignored 'target' and returned the contents, so write + # them out here. A curlInterface that honours 'target' itself returns + # no 'result', and then the file was never held in memory at all. FileString( opt.target, res.result ); Unbind( res.result ); fi;