Author Topic: Read file from internet  (Read 1865 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

  • Swamp Rat
  • Posts: 1144
  • 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: 385
  • 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: 385
  • 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

  • Swamp Rat
  • Posts: 1144
  • Ukraine

snownut2

  • Swamp Rat
  • Posts: 934
  • ADT 2004 - AutoCad 2011 Bricscad 19
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