-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pingback restriction not always respected
- Loading branch information
1 parent
943f00e
commit 162bb79
Showing
9 changed files
with
124 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20201111 | ||
20201117 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,33 @@ | ||
/*------------------------------------------------------------------------ | ||
Name: getRemoteFile.p | ||
Desc: Return a remotely hosted file as longchar | ||
------------------------------------------------------------------------*/ | ||
|
||
DEFINE INPUT PARAMETER pcRemoteFile AS CHARACTER NO-UNDO. | ||
DEFINE OUTPUT PARAMETER pcContents AS LONGCHAR NO-UNDO. | ||
|
||
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. /* URLDownloadToFileA */ | ||
|
||
PROCEDURE DeleteUrlCacheEntry EXTERNAL "WININET.DLL" : | ||
DEFINE INPUT PARAMETER lbszUrlName AS CHARACTER. | ||
END PROCEDURE. /* DeleteUrlCacheEntry */ | ||
|
||
|
||
/* Main | ||
*/ | ||
{&_proparse_prolint-nowarn(varusage)} | ||
DEFINE VARIABLE iResult AS INTEGER NO-UNDO. | ||
DEFINE VARIABLE cTempFile AS CHARACTER NO-UNDO. | ||
|
||
/* Figure out a temp name */ | ||
#GetName: | ||
REPEAT: | ||
cTempFile = SUBSTITUTE('&1_remote-file-&2.txt', SESSION:TEMP-DIRECTORY, ETIME). | ||
IF SEARCH(cTempFile) = ? THEN LEAVE #GetName. | ||
END. | ||
|
||
/* Download */ | ||
RUN DeleteURLCacheEntry (INPUT pcRemoteFile). | ||
|
||
{&_proparse_prolint-nowarn(varusage)} | ||
RUN urlDownloadToFileA (0, pcRemoteFile, cTempFile, 0, 0, OUTPUT iResult). | ||
|
||
/* Read */ | ||
IF SEARCH(cTempFile) <> ? THEN COPY-LOB FILE cTempFile TO pcContents. | ||
pcContents = TRIM(pcContents). | ||
|
||
/* Cleanup */ | ||
/*------------------------------------------------------------------------ | ||
Name: getRemoteFile.p | ||
Desc: Return a remotely hosted file as longchar | ||
------------------------------------------------------------------------*/ | ||
|
||
DEFINE INPUT PARAMETER pcRemoteFile AS CHARACTER NO-UNDO. | ||
DEFINE OUTPUT PARAMETER pcContents AS LONGCHAR NO-UNDO. | ||
|
||
{&_proparse_prolint-nowarn(varusage)} | ||
DEFINE VARIABLE iResult AS INTEGER NO-UNDO. | ||
DEFINE VARIABLE cTempFile AS CHARACTER NO-UNDO. | ||
|
||
/* Figure out a temp name */ | ||
#GetName: | ||
REPEAT: | ||
cTempFile = SUBSTITUTE('&1_remote-file-&2.txt', SESSION:TEMP-DIRECTORY, ETIME). | ||
IF SEARCH(cTempFile) = ? THEN LEAVE #GetName. | ||
END. | ||
|
||
/* Download */ | ||
RUN DeleteURLCacheEntry (INPUT pcRemoteFile). | ||
|
||
{&_proparse_prolint-nowarn(varusage)} | ||
RUN urlDownloadToFileA (0, pcRemoteFile, cTempFile, 0, 0, OUTPUT iResult). | ||
|
||
/* Read */ | ||
IF SEARCH(cTempFile) <> ? THEN COPY-LOB FILE cTempFile TO pcContents. | ||
pcContents = TRIM(pcContents). | ||
|
||
/* Cleanup */ | ||
OS-DELETE VALUE(cTempFile). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.