how to load client-side xml file?

M

memiller

I know this generally not recommended, but I'm working in the confines
of the company's intranet.

Goal: permit managers to load an XML file from thier PC into an
intranet ASP.NET webpage where validation and data submit will take
place. I have the page written that allows the user to select a
file. I'm hitting a wall when, after selecting the file, trying to
open a new page and inserting the XML into the page. From there I can
start validating the data. I've been tried to using
Response.BinaryWrite but it appears that will only work with server-
side files. I also haven't had much luck in trying to open the file
with Javascript. Any suggestions?
 
D

David Mark

I know this generally not recommended, but I'm working in the confines
of the company's intranet.

That would depend on the company and Intranet.
Goal: permit managers to load an XML file from thier PC into an
intranet ASP.NET webpage where validation and data submit will take

ASP.NET is OT here.
place.  I have the page written that allows the user to select a
file.  I'm hitting a wall when, after selecting the file, trying to
open a new page and inserting the XML into the page.  From there I can
start validating the data.  I've been tried to using
Response.BinaryWrite but it appears that will only work with server-
side files.  I also haven't had much luck in trying to open the file
with Javascript.  Any suggestions?

Post some (if not all) of the suspect (client side) code?
 
L

Laser Lips

That would depend on the company and Intranet.




ASP.NET is OT here.


Post some (if not all) of the suspect (client side) code?

You don't / CANT open files with javascript...You use the browser to
do that. You can't let javascript handle an XML file until it's on a
server somewhere. Then you can easily play with the file in
JavaScript. But that's all you can do with it. You can't CHANGE the
file with JavaScript or save it to another file. JavaScript sits in a
browser and is limited to it's sandbox. Go and read what JavaScript
Is!
 
E

Evertjan.

Laser Lips wrote on 14 okt 2008 in comp.lang.javascript:
You don't / CANT open files with javascript...You use the browser to
do that. You can't let javascript handle an XML file until it's on a
server somewhere. Then you can easily play with the file in
JavaScript. But that's all you can do with it. You can't CHANGE the
file with JavaScript or save it to another file. JavaScript sits in a
browser and is limited to it's sandbox. Go and read what JavaScript
Is!

Javascript can be used by Wscript or Cscript and on the server under ASP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top