Wolfgang Schölmberger
Member
Hi everybody,
i have a quite simple program to download pdf-files. It works perfectly with http, but fails with https. Both URLs work in explorer/firefox. Can anybody point out whats wrong ?
i have a quite simple program to download pdf-files. It works perfectly with http, but fails with https. Both URLs work in explorer/firefox. Can anybody point out whats wrong ?
Code:
/*-------------------------------------------------------------------------------------------------------------*/
DEF VAR cURL AS CHAR NO-UNDO.
DEF VAR cLocalFileName AS CHAR NO-UNDO.
DEF VAR iRetC AS INT NO-UNDO.
ASSIGN
cLocalFileName = "c:\temp\test.pdf"
/*------------ THIS FAILS -----------------*/
cURL = "https://datapadmo.it-park.at/Projekte/datapad/smg/datapad.nsf/api/uploads/Uebernahmeprotokoll_Stift_Klosterneuburg_123_10-07-2018_16-28-47.pdf?file=Uebernahmeprotokoll_Stift_Klosterneuburg_123_10-07-2018_16-28-47.pdf&customer=DgmGHz97HFnb73Nc9"
/*------------ THIS WORKS -----------------*/
cURL = "http://datapad.it-park.at/datapad/igel/pdfuploads/a556afa309b7598f20_Übergabeprotokoll__27-02-2017_16_47_46.pdf"
.
/* remove old version from IE cache */
run DeleteURLCacheEntry (input cURL).
/* ...and from explorer */
OS-DELETE VALUE(cLocalFileName) NO-ERROR.
/* download the new file-version */
run urlDownloadToFileA (0, cURL, cLocalFileName, 0, 0, OUTPUT iRetC).
MESSAGE "downloading:~t" cURL
"~n~nto:~t~t" cLocalFileName
"~n~nReturnCode:~t" iRetC
"~n~nlocal file exists:~t" SEARCH(cLocalFileName) <> ?
VIEW-AS ALERT-BOX INFO BUTTONS OK TITLE PROGRAM-NAME(1).
/**********************************************************************************************
EXTERNAL PROCEDURES *
*********************************************************************************************/
procedure URLDownloadToFileA external "URLMON.DLL" :
define input parameter pCaller as long.
define input parameter szURL as character.
define input parameter szFilename as character.
define input parameter dwReserved as long.
define input parameter lpfnCB as long.
define return parameter ReturnValue as long.
end procedure.
procedure DeleteUrlCacheEntry external "WININET.DLL" :
define input parameter lbszUrlName as character.
end procedure.
Last edited by a moderator: