code
Member in Training
Posts: 74
|
Post by code on May 14, 2020 20:13:54 GMT
Hi, If you compile the code below on www.onlinecompiler.net/you get a tool to download a file. Rename it to urltool.exe Here the compile code (urltool.exe): #include <windows.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
typedef HRESULT (__stdcall *ru)(LPCTSTR,LPCTSTR,LPCTSTR,int,int);
HINSTANCE hDLL;
hDLL= LoadLibrary("urlmon.dll");
if (hDLL == NULL) {
} else {
ru td = (ru)GetProcAddress(hDLL, "URLDownloadToFileA");
int res= td(NULL,(LPCTSTR)argv[1], (LPCTSTR)argv[2],0,0);
}
}
urltool.exe (4.5 KB) And run it with : The urltool.exe has to be in the same directory... Here also .bas file with download button...Goodluck!
nomainwin
WindowWidth=800
WindowHeight=600
button #scr, "Download image... ", [b1], UL, 150, 100
open "Download..." for graphics_nsb as #scr
print #scr, "fill yellow"
print #scr, "flush"
wait
[b1]
RUN "urltool.exe http://jbfilesarchive.com/images/Logo_LibertyBASIC.png Logo_LibertyBASIC.png"
b$ = "Logo_LibertyBASIC.png"
RUN "rundll32.exe url.dll,FileProtocolHandler ";b$
wait
Regards, code
|
|
|
Post by Enzo on Jun 5, 2020 21:03:53 GMT
What is a latency of the download, will you be working on upload too?
~ Enzo
|
|
code
Member in Training
Posts: 74
|
Post by code on Jun 7, 2020 9:44:31 GMT
That (see download progress)is not so easy to do on www.onlinecompiler.net/ . You have no control of 'linking' on that site. And I am not working on a FTP protocol. Regards, code
|
|
|
Post by Enzo on Jun 8, 2020 15:09:40 GMT
Here's a what if, What if upload-client and server is made and client only download periodicly from my own website? Seems like clean way to recieve data without too much headache
~ Enzo
|
|