Source language: Translate to:

how save files in an internet Server - Please somebody tell

Questions or information that don't quite fit anywhere else

Moderator: Neosoft Support

how save files in an internet Server - Please somebody tell

Postby MeLgA » Thu Jun 17, 2004 10:38 am

I am doing a website with neobook, but  i can NOT save a file in the website directory, it goes everytime to my disk drive. Exemple When i do FileWrite "!http://mywebsit.com/file.txt" "1" "Text" it say this "Cannot create file C:\\http://mywebsit.com/file.txt" but i dont want to put file in drive C.
Tell me, what i want can be done? and how?
Thanks
MeLgA
 

how save files in an internet Server

Postby SpiritHorseNOOT » Thu Jun 17, 2004 12:52 pm

put the filename and path in a viariable and then use the ! char

example

setvar "[myvar]" "c:\myDocs\test.txt"

FileWrite "![myvar]" "1" "test"


ok so i read it wrong but that is how you would use the ! char otherwise neobook seems to think it is a normal char


(Edited by SpiritHorseNOOT at 3:54 pm on June 17, 2004)
SpiritHorseNOOT
 

how save files in an internet Server

Postby MeLgA » Fri Jun 18, 2004 10:38 am

that dont work. the problem is that when i try to save a file in my website, neobook put drive "C:\" before the path, for exemple i do
SetVar "[dir]" "http://hardsoft.com.sapo.pt/teste.txt"
FileWrite "![dir]" "1" "sucesso1"
and it do an error "Cannot create file C:\\http://hardsoft.com.sapo.pt/teste.txt"
if you now some other way to save with a plug in or something tell me
i am testing in this page see it and hit "Gravar" Button
http://hardsoft.com.sapo.pt/
MeLgA
 

how save files in an internet Server

Postby Sam Cox » Fri Jun 18, 2004 10:56 am

If you're willing to learn a bit of LISP and the syntax for a new plug-in, the newLISP.DLL (accessible via the hpwNewLisp plug-in) provides the 'put-url' function which could work for you.

    (put-url "http://mysite.com/myfile.txt" "This is my text.")

creates the file named 'myfile.txt' on the target server and stores the text string "This is my text." in it. Using the hpwNewLisp plug-in, this would be written as follows:

    hpwNewLispCall "(put-url {http://mysite.com/myfile.txt} {This is my text.})" "[result]"
User avatar
Sam Cox
 
Posts: 768
Joined: Fri Apr 01, 2005 7:30 am
Location: Loveland CO USA

how save files in an internet Server

Postby MeLgA » Fri Jun 18, 2004 11:39 am

can you tell me how i can learn using that Plugin
MeLgA
 

how save files in an internet Server

Postby MeLgA » Fri Jun 18, 2004 11:58 am

ok i do like this
hpwNewLispCall "put-url {http://hardsoft.com.sapo.pt/teste.txt} {Texto aki.}" "[result]"
there were no errors but result return nothing and there is still no file created i'd like to leran how to use that plugin you told me
MeLgA
 

how save files in an internet Server

Postby Sam Cox » Fri Jun 18, 2004 12:02 pm

The hpwNewLisp plug-in has only two commands:

1)  Specify the newLisp.dll directory by executing something like the following command just once in your program; I usually put this command in Book Properties Actions Startup.

   hpwSetNewLispDir "c:\program files\neobook 4\plugins\hpwNewLisp"
   
2)  Use the following command to execute Lisp code.

   hpwNewLispCall "<lisp code>" "[resultVariable]"
   
That's all there is to know about using the plug-in ... really! Now you need to learn a little bit of the newLisp language, and for that there is a website (www.newlisp.org) and a very good manual downloadable from that site. The manual, however, assumes you know about LISP and are familiar with its somewhat different view of the world.

For your immediate need,

   setvar "[myfile]" "http://mysite.com/myfile.txt"
   setvar "[mytext]" "This is a long line of text\r\nThis is another line."
   
or perhaps

   FileRead "[mytext]" "all" "FileOnDisk"
   
and then
   
   hpwNewLispCall "(put-url {[myfile]} {[mytext]})" "[result]"

Notice the curly braces around [myfile] and [mytext] in the above expression. newLisp has several ways of quoting strings. The normal double-quote (") is one way; curly braces is another way. The use of curly braces is very convenient for quoting Lisp string inside of Neobook strings; that's why I use them.

From the newLisp manual,

In order to use PUT mode the web server's software must be configured correctly. On the Apache web server use the 'Script PUT' directive in the section where directory access rights are configured.

Let us know if this works for you.
   
User avatar
Sam Cox
 
Posts: 768
Joined: Fri Apr 01, 2005 7:30 am
Location: Loveland CO USA

how save files in an internet Server

Postby MeLgA » Fri Jun 18, 2004 12:21 pm

it seems that we are making progress but now the problem is that the result variable return this error:
"ERR: server code 405: HTTP/1.1 405 Method Not Allowed\r\n"
and of course the file isnt created :(
MeLgA
 

how save files in an internet Server

Postby Gaev » Fri Jun 18, 2004 12:36 pm

MeLgA:


it seems that we are making progress but now the problem is that the result variable return this error:
"ERR: server code 405: HTTP/1.1 405 Method Not Allowed\r\n"
and of course the file isnt created


Does the server you are trying to place the file on allow this kind of update ? And if it does, are there any security (logon/password) pre-requisites ?


Also, if it is more convenient/allowed, you could save the file on your local disk first ... and then use FTP ; either invoke a stand alone facility or use of the plug-ins offered for NeoBook.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

how save files in an internet Server

Postby adrian » Fri Jun 18, 2004 7:55 pm

Hi
you can try with a ftp pluging, this plugins is chistian 's plugins, you can download  or aks for it here is hi's mail christian.chauvin@free.fr
adrian
 


Return to Misc. Questions and Information

Who is online

Users browsing this forum: No registered users and 2 guests

cron