ReadXml from client side??

  • Thread starter Thread starter Fernando Vaca
  • Start date Start date
F

Fernando Vaca

hi, i dont't know if it can be done, i want to write and read a xml file
from a client side.
I 've done this code:
-------------------------------------
Dim ds As DataSet
ds=filldata()

ds.WriteXml("c:\data.xml")
......
......
ds.ReadXml("c:\data.xml")
 
Are you doing this in a browser? Otherwise it should be pretty simple....
HOwever, if you are going to do this, it'll work just like any other HTML
method. You could write your file to the virtual directory and redirect
over to it, which will cause it to open in the browser. THis isn't elegant
and writing to your server carries with it some headaches. You could create
the file and push it down to the client, but you'd need to ask them where
they want it and confirm they have client side permissions. Also, you'd
need an interface to allow them to choose the source of the file when they
are reading the file. There are tons of examples out there using ASP.NET
http://www.freevbcode.com/ShowCode.Asp?ID=2136
(This is actually what you really need )
http://www.devarticles.com/c/a/ASP.NET/HTTP-File-Download-Without-User-Inter
action-Using-.NET/

HOwever, if this is a client server app, then it's a lot easier.. you'll
just need to specify the path differently.

Which on is it?
 
¤ hi, i dont't know if it can be done, i want to write and read a xml file
¤ from a client side.
¤ I 've done this code:
¤ -------------------------------------
¤ Dim ds As DataSet
¤ ds=filldata()
¤
¤ ds.WriteXml("c:\data.xml")
¤ .....
¤ .....
¤ ds.ReadXml("c:\data.xml")
¤ -------------------------------------
¤ but it save the file (data.xml) at server side.

Writing files to the client without user intervention is a security issue that is typically not
permitted by the browser.

You should allow the user to download the file from the server, such as via http or ftp.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top