access file on server

I need to save and load an XML file to the server in a standard directory in order to display some nodes on the browser. How can I make a direct read-write access to the server from my back end code.

I’m not sure I understand your question. What kind of server? What kind of app? Where does the app run?

I USE THIS , LOCAL AND MINIMAC SERVER MAVERICK

Dim kTestXml As String
Dim xdoc as XmlDocument
Dim f as FolderItem

f = GetFolderItem("").child(“client.xml”)
xdoc = new XmlDocument(f)
xdoc.LoadXML(f)
MsgBox xdoc.ToString

I GET THIS INTERENT
Unhandled XmlException
Message: msg:unknown encoding ‘’

Stack:
RBXML.xojo_plugin_0.dylib$118
RBXML.xojo_plugin_0.dylib$45
RBXML.xojo_plugin_0.dylib$1716
RBXML.xojo_plugin_0.dylib$1717
RBXML.xojo_plugin_0.dylib$681
RBXML.xojo_plugin_0.dylib$680
RBXML.xojo_plugin_0.dylib$683
RBXML.xojo_plugin_0.dylib$1241
RBXML.xojo_plugin_0.dylib$1240
RBXML.xojo_plugin_0.dylib$1242
RBXML.xojo_plugin_0.dylib$1549
RBXML.xojo_plugin_0.dylib$1550
RBXML.xojo_plugin_0.dylib$182
RBXML.xojo_plugin_0.dylib$183
XmlDocument.Constructor%%oo
WebPage1.WebPage1.B_Inscription_Action%%o<WebPage1.WebPage1>o
Delegate.IM_Invoke%%o
AddHandler.Stub.28%%
WebButton._ExecuteEvent%b%osA1v
WebControl.!_ExecuteEvent%b%ssA1v
WebSession._HandleEvent%%oso<HTTPServer.HTTPRequestContext>
WebSession._HandleRequest%i4%oso<HTTPServer.HTTPRequestContext>
WebApplication.HandleHTTPRequest%%oo<HTTPServer.HTTPRequestContext>
_CGIGateway.GatewayRequestThread.Event_Run%%o<_CGIGateway.GatewayRequestThread>
rbframework.dylib$1086
_pthread_body

I GET THIS LOCAL
UNKNOW ENCODING

Sounds like you need to do a bit more debugging. What is the XML file? What is its encoding? XML files are typically UTF-8. Is this specified in its header? Are there invalid characters in the XML? Can you copy the file locally and open it?

I’ve found that opening problem XML files in something that tries to parse them (like the Firefox browser, strangely enough) often helps pinpoints what might be wrong.

THIS IS THE XML FILE :

<?xml version="1.0" encoding="utf-8" ?> University of XML Department of XML parsing George Washington Abraham Lincoln Bill J. Clinton George W. Bush Barack H. Obama Song Li

THE kTestXml STRING is encode US-ASCII

I did various tests to transform the variable to UTF8, but without result. How can I do?

does it actually include the embedded newlines ?

Exception as XML Exception
Error number 69

I dont know about embedded newlines.

I copied your xml into a file and it opens fine. There must be some bad character in the original that didn’t transfer to the forum.

I created a new XML file with Dreamweaver and I deleted the old one. This always leads to the exception.

Zip the file & send it to me directly
norman@xojo.com

Sounds like dreamweaver is creating a bad XML file

Even after saving the file Alain sent it opens fine with

  Dim kTestXml As String
  Dim xdoc as XmlDocument
  Dim f as FolderItem
  
  f = GetOpenFolderItem("") // instead of getfolderitem("")..child("client.xml") so I can pick the file where I downloaded it
  xdoc = new XmlDocument(f)
  xdoc.LoadXML(f)
  MsgBox xdoc.ToString

Very odd

Running tidy on it also says it’s valid as do a couple other online checkers

Errors

! This item does not exist.
GetOpenFolderItem

Don’t run.
Can’t build.

I do not use the Pro version but the web application.
I do not know if it can change a few things.

Odd

After many tests.

The webapp run well on server, but not locally.

Happy Christmas!
We will enjoy this wonderful winter full of snow.

Alain