View previous topic :: View next topic |
Author |
Message |
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Mar 11, 2004 2:39 pm Post subject: File download with URLMON.DLL and VDSug.dll |
|
|
VDS 3 and VDS 4 compatible
Here's a VDSug.dll conversion of Skit's URLMON.DLL
example in the "Visual DialogScript 5 Units" forum.
It takes a file URL and a local destination path\filename
as command parameters.
Note: The function only downloads existing files, it
will NOT retrieve web pages that are created as you
log on (such as the index.php for VDSworld forums).
Not on my system anyway.
Requires VDSug.dll, IE 3 or later, and Windows 95 or later.
_____________________________________________________________________________________________________________
Code: |
TITLE Urlmon.dll Download Utility
if @not(%1)@not(%2)
WARN Insufficient parameters...@tab()
EXIT
end
rem -- target URL and destination path\filename --
%%url = %1
%%file = %2
EXTERNAL VDSug.dll
UG DLLLOAD, 1, urlmon.dll
UG DLLINITFUNC, 1, 1, URLDownloadToFileA
OPTION ERRORTRAP, t1
rem -- %z is zero unless memory error --
%z = @ug(DLLFUNC, URLDownloadToFileA, int, int:0, str:%%url, str:%%file, int:0, int:0)
:t1
if @file(%%file)
INFO Download complete...@tab()
else
WARN Download failed!@tab()
end
|
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Mar 11, 2004 11:19 pm Post subject: |
|
|
A note on this example...
If you do not delete an existing file before downloading it
again, the popup window will show "Download Complete"
even if the download was a failure.
This is because it checks the file's existence as verification of
download success. As an alternative, you could add code to
check an existing file's timestamp before and after download
for verification.
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|