TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: TopoWAR on October 06, 2011, 12:49:57 PM
-
Hi Everyone! Is there any way to download a file online? for example, "http://www.opendcl.com/version/version.txt"
thanks
-
See here (http://www.theswamp.org/index.php?topic=33750) and here (http://www.theswamp.org/index.php?topic=15188.msg184371#msg184371).
-
you don't have to save the file just to know the odcl's version
(defun vk_GetRemoteText (RemoteFileName / objHTTP Result)
(if (setq objHTTP (vlax-create-object "WinHTTP.WinHTTPRequest.5.1"))
(progn (setq
Result (vl-catch-all-apply
(function
(lambda ()
(vlax-invoke-method
objHTTP "Open"
"GET" RemoteFileName
:vlax-false
)
(vlax-invoke objHTTP "Send")
(vlax-get-property objHTTP "ResponseText")
)
)
)
)
(vlax-release-object objHTTP)
(if (not (vl-catch-all-error-p Result))
Result
)
)
)
)
;;;(vk_GetRemoteText "http://www.opendcl.com/version/version.txt")
-
you don't have to save the file just to know the odcl's version
wow :kewl:
-
That is cool 8-)
-
you don't have to save the file just to know the odcl's version
Not sure if this applies to the WinHTTP Object, but here (http://www.theswamp.org/index.php?topic=39491.0) I found the XMLHTTP Object seemed to cache the result when using the "GET" keyword, so you may want to use the "POST" operator.
Lee
-
by teachers, great code!! :lol:
-
i share with pleasure, thanks
Not sure if this applies to the WinHTTP Object, but here (http://www.theswamp.org/index.php?topic=39491.0) I found the XMLHTTP Object seemed to cache the result when using the "GET" keyword, so you may want to use the "POST" operator.
Lee
i can't say anything for sure, know nothing about http
i've just googled this http://www.cs.tut.fi/~jkorpela/forms/methods.html (http://www.cs.tut.fi/~jkorpela/forms/methods.html)
there is a paragraph about "caching" but as i've understood it's about cahing a request on a server not a local file
-
Not sure if this applies to the WinHTTP Object, but here (http://www.theswamp.org/index.php?topic=39491.0) I found the XMLHTTP Object seemed to cache the result when using the "GET" keyword, so you may want to use the "POST" operator.
Lee
i can't say anything for sure, know nothing about http
i've just googled this http://www.cs.tut.fi/~jkorpela/forms/methods.html (http://www.cs.tut.fi/~jkorpela/forms/methods.html)
there is a paragraph about "caching" but as i've understood it's about cahing a request on a server not a local file
That's an interesting link, I shall have to take some time to read it more thoroughly.
I remember reading the following from here (http://msdn.microsoft.com/en-us/library/ms536648%28v=VS.85%29.aspx):
Internet Explorer caches the results of HTTP GET requests in the Temporary Internet Files (TIF) folder. In most cases, caching improves performance for data that will not change frequently. To guarantee that the results are not cached, use POST.
I noticed this caching when testing my Internet Time function, so thought I'd make you aware of the possibility.
At least, if a similar issue arises in the future you will know what to do :-)
-
Hi Everyone! Is there any way to download a file online? for example, "http://www.opendcl.com/version/version.txt"
thanks
I know there was a topic to download the BBC news and the BCC weather forecast into the drawing,
but I can’t find it.
Lee your Internet Time function, is this giving the current internet date and time?
-
Hi Everyone! Is there any way to download a file online? for example, "http://www.opendcl.com/version/version.txt"
thanks
I know there was a topic to download the BBC news and the BCC weather forecast into the drawing,
but I can’t find it.
http://www.theswamp.org/index.php?topic=37107 (http://www.theswamp.org/index.php?topic=37107)
:-)
-
code only works for text files, is this true ?
Is there some code that works for example with jpg or rar ?
-
code only works for text files, is this true ?
Is there some code that works for example with jpg or rar ?
See my earlier links above.
-
code only works for text files, is this true ?
true, what do you expect from function named "vk_GetRemoteText"? :)
-
Hi Everyone! Is there any way to download a file online? for example, "http://www.opendcl.com/version/version.txt"
thanks
I know there was a topic to download the BBC news and the BCC weather forecast into the drawing,
but I can’t find it.
http://www.theswamp.org/index.php?topic=37107 (http://www.theswamp.org/index.php?topic=37107)
:-)
Thanks Lee,
Your Internet Time function, is this giving the current internet date and time?
-
Your Internet Time function, is this giving the current internet date and time?
Yes, the data is sourced from the NIST time server, the time is expressed in UTC (http://en.wikipedia.org/wiki/UTC) (Coordinated Universal Time).