Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have investigated this further and have re-ordered my suggestions from last week as a result:</p> <ol> <li><p>The class 'CHttp' in VO's 'Internet' library has a method GetFile (<a href="http://www.cavo.com/pubcavo/patch/2.5/whats_new_in_25b.pdf" rel="nofollow">the VO 2.5 "what's new" has a brief description on page 10</a>). I've not tried it, though. You'll probably want something like this:</p> <pre><code>local oSession as CHttp local lSuccess as logic oSession := CHttp{} oSession:ConnectRemote("foo.example.com") // Server domain name lSuccess := oSession:GetFile("bar/baz.pdf",; // Remote filename "c:\temp\baz.pdf",; // Local filename lFailIfAlreadyExists) oSession:CloseRemote() // If lSuccess, the file should be downloaded to cLocalFileName. // I don't know whether the filename arguments should use / or \ for directory separators. </code></pre></li> <li><p>I think another way is to use the Windows <code>ShellExecute</code> function to invoke an external program which downloads the file. I found an example of ShellExecute <a href="http://www.rhinocerus.net/forum/lang-clipper-visual-objects/125486-execute-program.html" rel="nofollow">here</a>. I haven't tried this as I don't have a VO compiler (or help file!) available to me at the moment. I'm not sure whether this is a good way or not, and I don't know whether it's safe from people trying to run a malicious command by supplying a sneaky filename. But I think the following <em>might</em> work. It assumes you have the program <code>curl.exe</code> (see: <a href="http://en.wikipedia.org/wiki/CURL" rel="nofollow">curl</a>) on your path, which is used for downloading the file. You may need the fully path of <code>curl.exe</code> instead. I'm not sure where the file will be saved by default (I think you can specify a working directory in the parameter labelled <code>lpDirectory</code>)</p> <pre><code>local cParameters as string local cURL:="http://www.example.com/interesting.htm" as string local cLocalFile:="savefile.html" as string cParameters := "-o "+cLocalFile+" "+cURL ShellExecute(NULL /*Window handle*/,; String2PSZ("open"),; String2PSZ("curl.exe"),; String2PSZ(cParameters),; NULL_PTR /* lpDirectory */,; SW_SHOWNORMAL) </code></pre> <p>See also <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb762153%28v=vs.85%29.aspx" rel="nofollow">the MSDN page for ShellExecute</a>.</p></li> <li><p>There appears to be a method <code>App:Run(cCommand)</code> which can be used to start external applications</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload