Author Topic: Read file from internet  (Read 4417 times)

0 Members and 1 Guest are viewing this topic.

josan

  • Mosquito
  • Posts: 15
Read file from internet
« on: September 02, 2013, 01:53:18 PM »
I need to read a file located on a web server. "https://www.dropbox.com/s/uyrkr4ocpzutijq/Hola.txt".
After searching and find some codes the result is not as expected as in the examples you can read the data that really in the content of the file but in my case not possible.

It will be the destination server?
Thanks for your help ...
 
Example: (http://www.theswamp.org/index.php?topic=39663.msg449737#msg449737)
Code: [Select]
(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")
;;;(vk_GetRemoteText "https://www.dropbox.com/s/uyrkr4ocpzutijq/Hola.txt")

VovKa

  • Water Moccasin
  • Posts: 1626
  • Ukraine
Re: Read file from internet
« Reply #1 on: September 02, 2013, 03:07:46 PM »
Code: [Select]
(vk_GetRemoteText "http://dl.dropboxusercontent.com/s/uyrkr4ocpzutijq/Hola.txt")

josan

  • Mosquito
  • Posts: 15
Re: Read file from internet
« Reply #2 on: September 02, 2013, 05:43:54 PM »
Thanks very friendly ...

Solved!

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Read file from internet
« Reply #3 on: September 09, 2013, 03:09:03 AM »
the read-code is great! If you share files with "dropbox" can you see, which computer sharing your files ?
My idea is, to create a license-file in dropbox and then share them with my collegues.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Read file from internet
« Reply #4 on: November 25, 2013, 03:10:22 AM »
Have the "WinHTTP.WinHTTPRequest.5.1" interface possibility to load a dll from dropbox too?

VovKa

  • Water Moccasin
  • Posts: 1626
  • Ukraine

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: Read file from internet
« Reply #6 on: November 25, 2013, 08:12:39 AM »
Have the "WinHTTP.WinHTTPRequest.5.1" interface possibility to load a dll from dropbox too?

Dirk,

I have tried to see who has downloaded files from DropBox, I did not find it possible.  Seems from your post here it is possible, care to share how.

Bruce

FELIX

  • Bull Frog
  • Posts: 241
Re: Read file from internet
« Reply #7 on: May 24, 2020, 09:17:27 PM »
I need to read a file located on a web server. "https://www.dropbox.com/s/uyrkr4ocpzutijq/Hola.txt".
After searching and find some codes the result is not as expected as in the examples you can read the data that really in the content of the file but in my case not possible.

It will be the destination server?
Thanks for your help ...
 
Example: (http://www.theswamp.org/index.php?topic=39663.msg449737#msg449737)
Code: [Select]
(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")
;;;(vk_GetRemoteText "https://www.dropbox.com/s/uyrkr4ocpzutijq/Hola.txt")

This function has stopped working and returns an expired certificate message. Does anyone know how to update?
OK.

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: Read file from internet
« Reply #8 on: May 24, 2020, 09:40:50 PM »
I just manually checked the link for the Hola.txt and got a 404 (not found), perhaps they moved the file or removed it altogether.
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

FELIX

  • Bull Frog
  • Posts: 241
Re: Read file from internet
« Reply #9 on: May 24, 2020, 10:30:59 PM »
Solved, the system I was testing is that the certificate has expired.
OK.

navsun

  • Mosquito
  • Posts: 1
Re: Read file from internet
« Reply #10 on: July 07, 2020, 01:10:49 AM »
Good ajax for lisp language, can it run asynchronously?
I’m from China