Jump to content

Recommended Posts

Posted (edited)

A few weeks ago I was given some useful code for reading data from a file off a website.

 

What I want to know is if it is also possible to write to a file on a website?

 

Here is the code that retrieves the data from file:

(defun c:wtw ()
(setq server "http://example.com.au/Folder/")
(setq SetSunFile "testpost.txt")
(setq SundayFilepath (strcat server SetSunFile))
 

(setq xmlSunday (vlax-create-object "MSXML2.XMLHTTP.3.0"))
(vlax-invoke-method xmlSunday 'open "POST" SundayFilepath :vlax-false)
(vlax-invoke-method xmlSunday 'send)
(setq strSunday (vlax-get-property xmlSunday 'responsetext))

abd here is what I tried to add to write to file....whichc doesn't work.

(vlax-put-property SundayFilepath 'Write testwr)

thanks

Edited by Andrew1979
Posted

FYI This code was for your protection routine so dont post true website address, remove strcat etc not needed (strcat "testpostSunday.txt")

 

Have a look at this link its not lisp but does talk about writing a txt file to a server https://msdn.microsoft.com/en-us/library/ms766431(v=vs.85).aspx

 

something like

 

(vlax-invoke-method xmlSunday 'send)
(vlax-put-property xmlSunday 'write testwr)

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...