Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > how to downloas xml file

Reply
Thread Tools

how to downloas xml file

 
 
Emmanuel Kahn
Guest
Posts: n/a
 
      07-17-2003
Hi Sreejumon and thanks

I would like to download xml and the user must select the path of the
downloaded file
the user will select where the file will be saved !!!

two problems:

1)I know that I can create a XML file on my server using writexml method
of the dataset.
To download the file I use simple HREF or asp hyperlink
for .doc file for instance it will automatically open a dialog box
asking the user open/save and where to save this file.
for xml the browser automatically open the file. when I want to save it
only and not to open it.

2) with rendercontrol how can the user select the path ?

thanks

Manu




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      07-18-2003
Hi Emmanuel,

The code below gets a dataset and pushes it out as a file for download. Does it
do what you need?

Ken
MVP [ASP.NET]


Imports System.io
Public Class writexmlp
Inherits System.Web.UI.Page


Private Sub Button1_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
Dim ds As New DataSet
ds.ReadXml(Server.MapPath("a.xml"))
Dim xmlstream As New MemoryStream
ds.WriteXml(xmlstream)
Response.AppendHeader _
("Content-disposition", _
"attachment; filename=a.xml")
Response.ContentType = "application/download"
Response.BinaryWrite(xmlstream.ToArray())
Response.End()
End Sub
End Class



"Emmanuel Kahn" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
Hi Sreejumon and thanks

I would like to download xml and the user must select the path of the
downloaded file
the user will select where the file will be saved !!!

two problems:

1)I know that I can create a XML file on my server using writexml method
of the dataset.
To download the file I use simple HREF or asp hyperlink
for .doc file for instance it will automatically open a dialog box
asking the user open/save and where to save this file.
for xml the browser automatically open the file. when I want to save it
only and not to open it.

2) with rendercontrol how can the user select the path ?

thanks

Manu




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
including one XML file in another XML file Johan XML 20 02-27-2007 04:29 PM
Problem to insert an XML-element by XSLT-converting from one XML-file into another XML-file jkflens XML 2 05-30-2006 09:41 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
UPnP xml file to WSDL xml file Robert S XML 1 10-14-2005 09:32 PM
tool to validate xml file against custom XML Schema file Leona XML 9 11-01-2004 09:51 AM



Advertisments