Jump to content

Read text file from a server on the internet


Recommended Posts

Posted

Hello

 

Could someone help me, I need to access a txt file to read a folder on a server by ip with visual lisp

 

Example:

 

Folder: https://xxx.xxx.xxx.xxx/d://teste/arquivoteste.txt
Where:
xxx.xxx.xxx.xxx and the ip address or ftp.xxxxx.com.br
test is a folder on the D:// drive
testfile.txt is the file to be read to retrieve the content

 

Thanks
hildevasco

Posted (edited)

try this code

(defun get (url / outtext xml)
  (setq xml (vlax-create-object "Microsoft.XMLHTTP"))
  (vlax-invoke xml 'open "GET" url 0)
  (vlax-invoke xml 'setrequestheader "If-Modified-Since" 0) ;_ 
  (vlax-invoke xml 'send)
  (setq outtext (vlax-get xml "responseText"))
  (vlax-release-object xml)
  (princ outtext)
  (princ)
)

 

Edited by fan_zh

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...